View Full Version : anchor and href question
nancy_lee
11-19-2002, 08:03 PM
Hi,
I am trying to create a anchor tag with 2 functions but I don't know how to do it :
I need to run a javascript to validate data and then I want to link to a different page. If you have other suggestions please let me know too.
Please help ASAP 'cos I need to finish this project soon.
Thanks a lot!
NL
joh6nn
11-19-2002, 08:31 PM
can we see a link to the page you're working on, or could you post the code? also, since this is a javascript question, it really belongs in the JavaScript forum. so that you know for the next time.
nancy_lee
11-19-2002, 08:49 PM
Below is the codes that I am working on:
validdateandsubmit = validate all data on the form and submit
setflag = change a flag in the database
action.append("<td class=\"bgMenu\"><div class=\"LinkOnBgMenu\" style=\"text-align:center;padding:2px;padding-bottom:4px;\"> <A href= \"javascript:validateAndSubmit();\"/"+db.getFilePath().replace('\\','/')+"/(changeflag)?openAgent&taskID="+taskID+"&login\" class=\"LinkColorOnBgMenu\">go to products</a> </div></td><td width=\"20\"> </td>");
Thanks again!
joh6nn
11-20-2002, 04:54 AM
try this:
action.append('<td class="bgMenu"><div class="LinkOnBgMenu" style="text-align:center;padding:2px;padding-bottom:4px;"> <A href="'+db.getFilePath().replace("\\","/")+'/(changeflag)?openAgent&taskID='+taskID+'&login" onClick="validateAndSubmit();" class="LinkColorOnBgMenu">go to products</a> </div></td><td width="20"> </td>');
nancy_lee
11-20-2002, 02:49 PM
Hey, John,
It works... thanks a lot.
I have another question ... if I need to put another function to onClick, is this what I should do -
openAgent&taskID='+taskID+'&login" onClick="validateAndSubmit(); SECONDFUNCTION()"
Thanks again.:o
joh6nn
11-20-2002, 03:35 PM
yep. that's it exactly.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.