LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   any good ideas for disabling links? (https://www.linuxquestions.org/questions/programming-9/any-good-ideas-for-disabling-links-200144/)

scabies 07-01-2004 09:47 PM

any good ideas for disabling links?
 
i have sort of an odd problem...

i have some display pages that include links (when clicked, javascript confirm box pops up) and when they are clicked and confirmed, i would like to disable the links. i know that if they were buttons it would be fairly straightforward; however due to the overall design and code making them buttons would be a poor design choice. i'll note that the javascript is being output into the page by PHP.

so is there a way to use the javascript to display the HTML for the link, and then upon confirm, re-displaying it to not be a link? or some other way? for the sake of completeness i've included the code for the links below. any ideas would be a huge help!

thanks in advance,
mike



$title = CLICK_TO ."${action}". " ". THE_LOWERCASE ."${servername}". SERVER;
println(" <td class=\"$class\"><div class=\"${action}button\"><a href=\"${filename}?appID=${appID}&action=${action}&mode=${mode}&servertype=${servertype}\" title=\"$title\"");
println(" onClick=\"return confirm('". ARE_YOU_SURE_YOU_WISH_TO ."$laction $servername?')\"");
println(" onMouseOver=\"javascript:window.status='". $title ."';return true;\" onMouseOut=\"javascript:window.status=''; return true;\">". $action ."</a></div></td>");

keefaz 07-02-2004 07:09 AM

Why don't you make it in php ? like
PHP Code:

// if I come from clicked link
if( $_SERVER["HTTP_REFERER"] == $your_form_url )
{
    
// add code without links
}
else
{
    
// add code with links




All times are GMT -5. The time now is 08:05 PM.