Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.