hi
i have a site which displays links to lots of news items. each link opens the news item in the current window. however, i'd like to have an option on the page where the user can check a check-box called 'launch in new window' and each link will open in a new window. i know the html to achieve this, but i cannot seem to get PHP to pick up the value of the checkbox and append it to the 'a href' target without re-loading the page...any ideas?
many thanks rob
Well, PHP can't do it without a page refresh, because it's running on the server, not the browser.
If you know Javascript to do the job, use that.
Or am I misreading your problem?
i managed to solve it with the following piece of DHTML/JavaScript code :
<script language="javascript"> <!-- function hyperlinks(target) { if (target) where = "blank"; else where = "self"; for(var i=0; i<=(document.links.length-1); i++) { document.links.target = where; } // end for } // end function //--> </script> <form><input type=checkbox name=targetnew onClick=\"hyperlinks(this.checked)\"> launch in new window</form> R