473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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";
  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 1272
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

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

Similar topics

4
by: Dodo | last post by:
Is it possible to create a link that can post a value to an ASP page without java?
1
by: reneecccwest | last post by:
Hello, I'd like to pass the "levelbtn" value when I click the filter button, but there are also other submit form buttons. I defined as "document.testform.submit();" in the javascript, but I...
2
by: Matt | last post by:
Can we click a link and it will submit the form to the other page? Usually we will submit the form to other page by clicking a submit button. Now I need to do the following, but what if I have...
4
by: dschruth | last post by:
Hello. Can anybody solve this problem? I am using a server-side language (PERL) to *try* to POST data to a HTTPS login script that doesn't have a standard "submit" button. The form appears...
26
by: Mica Cooper | last post by:
Hi, I need to pass some info in a javascript submit. <a href="javascript:document.formName.submit();">Submit Form</a> Normally a link would do page.jsp?x1=1&x2=2&x3=3 and you would pull x1,...
4
by: kschneider | last post by:
Assume there's a form with it's action attribute all set to post to a URL, but without a submit control. Form submission is done via a link and I want to prevent the classic "double submit"....
14
by: Wouter | last post by:
Hi, I try to make the follow. I want that i can click on a text link and that then a link wil be copyed in a input form box (<input type="text" name="img_url" />). I have google-ed about how...
7
by: Steve Swift | last post by:
How close can you get to making a submit button look like a link? Answers to the inevitable questions: 1. Because I don't want my email address (which would have to be part of the URL in a...
10
by: pt36 | last post by:
Hi I have a page with a form and a textbox. before to submit the form I want to chek if the inserted value in the textbox is already present in a database. So I need to pass the textbox value...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.