Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange Link Error

Status
Not open for further replies.

dweb77

Programmer
Jul 31, 2007
3
US
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

Code:
<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>
 
Is it possible the links are being covered by a DIV or
something when there is less content making them
unclickable? Without seeing more of the code (after PHP
has processed it) I'd only be grasping at straws.

Adam
 
So I found the problem but wonder if there is a way to deal with it for others...

The following code appears on the page at the bottom.

<script language='javascript'>postamble();</script>

I know it is there because I have Zone Alarm on my system. When I turn this off, the links work. For some reason this happens only if there are less than 5 records when the link is clicked.

Anybody know about this and if there is a workaround.

Thanks.

 
So what about for other users...Is there no way to override this such that I would need a note to let users know of the potential issue?

Any thoughts.

Thanks.
 
Code:
<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>

Maybe if you put the href call above on the onclick of the anchor, you won't need to disable Zone Alarm.

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


[monkey][snake] <.
 
So what about for other users...Is there no way to override this such that I would need a note to let users know of the potential issue?

If other users are running ZoneAlarm, from what I've read, they'll be experiencing all number of odd browsing errors, and so probably will count this as one of the multitude of things that ZA breaks.

If they're not running ZA, then from what you've said, they wont experience the issue.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top