469,271 Members | 1,176 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

link define and submit by javascript

i have a code like this
Expand|Select|Wrap|Line Numbers
  1. var total=document.getElementById("pagelimit").value;
  2.     var choice=confirm("Adakah anda pasti untuk set semula password bagi "+total+" rekod\!\nAre you sure to reset password for "+total+" record\!");
  3.     if (choice)
  4.     {    
  5.     str="http:\\somethingurl";
  6.  
  7.     }else{
  8.     str="http:\\somethingurl";    
  9.     }
so i want to make javascript to redirect to that str variable
mabe like this command:
Expand|Select|Wrap|Line Numbers
  1. document.link("str");
please make me know if this is correct
Nov 17 '08 #1
3 1120
Markus
6,050 Expert 4TB
Hey.

Check out this.
Nov 17 '08 #2
Hey.

Check out this.
thanks that rights..
Expand|Select|Wrap|Line Numbers
  1. onclick="javascript: ConfimForm();return false;"
but must typein this on the button if not the form will submit to the link that define on form tag...sure we don't want that
Nov 17 '08 #3
acoder
16,027 Expert Mod 8TB
You can either just use window.location.href directly, or when submitting, change the action of the form depending upon the confirm response from the user.
Nov 17 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Dodo | last post: by
1 post views Thread by reneecccwest | last post: by
26 posts views Thread by Mica Cooper | last post: by
14 posts views Thread by Wouter | last post: by
7 posts views Thread by Steve Swift | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.