Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    anchor and href question

    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

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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;\">&nbsp;<A href= \"javascript:validateAndSubmit();\"/"+db.getFilePath().replace('\\','/')+"/(changeflag)?openAgent&taskID="+taskID+"&login\" class=\"LinkColorOnBgMenu\">go to products</a>&nbsp;</div></td><td width=\"20\">&nbsp;</td>");

    Thanks again!

  • #4
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    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>');
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #5
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    yep. that's it exactly.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •