Jump to content

Very Strange Javascript/PHP issue


dweb77

Recommended Posts

 

I post this in case there is a general answer:

 

I have a php script that run's a query, returns a set of records, then displays results with a hyperlink on a letter. The letter/link allows for the particular row to be deleted. The link is coded with a javascript that runs a php page, opening a new window and deletes the record from the database, the window indicating with the text that the record was deleted.

 

When the total records are 5 records or more, the window opens when clicking the link and deletes the record as it is supposed to. When there are 4 records or less, the link does not work. Nothing happens when clicking on the link. This is true on one page. However, another page has the exact same javascript link and will open the window successfully and process even with the records fewer than 4.

 

There is no place in the javascript code that references the number 4 or total records < 5.

 

Is there any general type of situation where this is an issue? I have included the Javascript code below but not the php.

 

Any thoughts. Thanks

 


<SCRIPT LANGUAGE="JavaScript">

function SaveRemove(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=480,height=415,menubar=no,directories=no,location=no");
}

The link:

<a href="javascript:SaveRemove(\'school_remove.php?id=' . $sch['school_id'] . '&user=' . $user . '&name=' . $sch['s_id'] . '\',\'height=380,width=300,scrollbars=no\')"\;>R</a>

 

Link to comment
https://forums.phpfreaks.com/topic/62620-very-strange-javascriptphp-issue/
Share on other sites

Does the browser report any javascript errors?

 

If you post the full HTML for the page with the problem (or give us a link) I'm sure someone can work out what's wrong.  The fact that the window never opens makes me think it's a syntax error with the javascript, triggered by certain characters.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.