471,887 Members | 710 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

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";
  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 1149
6,050 Expert 4TB

Check out this.
Nov 17 '08 #2

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
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
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.