[Javascript] passing values in a link

Joseph Davis jdavis at sherikon.com
Mon May 14 10:11:34 CDT 2001



>>> ben at babelfish.co.uk 5/14/01 8:02:08 AM >>> 
You need to tell the form which page it is submitting the data too. 

<form name="myform" method="Get" action="thispage.asp"> 

You can pass data from page to page using your method (by building up the 
querystring yourself) but in this case there is no need. 

hope this helps. 

.b 

----- Original Message ----- 
From: "Varsou Nilsa" < nvarsou at infoserve.gr> 
To: < javascript at LaTech.edu> 
Sent: Monday, May 14, 2001 3:10 PM 
Subject: [Javascript] passing values in a link 


Hi everyone, I need some help, I am trying to pass a key value in a href 
link, I have done this before and I just don't get why is not working, 
the truth is I am a begginer in jscript, bellow I have my code, when I 
click the "take me there" link to de default.htm page I want to pass a 
key with the value of the T1.field on it, instead of this the link take 
me to the default page with a null key something like default.htm?key=, 
yet when I put a default value to the key (something like 
href="default.htm?key=" + 4) the result is still the same, what am I 
doing rong? 
TIA 

<form name="myform" method="Get"> 
<p><input type="text" name="T1" size="20"> 
<p><input type="text" name="T2" size="20"> 
<p> 
<input type="radio" name="showView" id=showView value="0"><label 
for="showAll" id="label1"> 
Show all </label> 
</p> 
<p> 
<input type="radio" name="showView" id=showView value="1" 
checked><label for="showFiltered " id="label2"> 
Filter </label> 
</p> 
</form> 
<script language="javascript"> 
function validate(){ 
if(document.myform.showView(0).checked){ 
document.myform.T1.value == ""; 
document.myform.T2.value == ""; 
} 

if(document.myform.showView(1).checked){ 
if(document.myform.T1.value == "" && 
document.myform.T2.value == ""){ 
alert("Sorry, you must fill at least one of the 

return false; 
} 
document.myform.submit(); 
} 
} 

</script> 

<p><a href="default.htm?key=" + document.myform.T1.value onClick="return 
validate()">take me there</a></p> 






Nilza Da Silva Varsou 
Web Developer 

INFOSERVE SA 
145 Vizantiou str. 
GR 142 35, Kalogreza 
Athens, Greece 
Tel. +30-1-2595300 
Fax +30-1-2595301 
------------------------------- 
www.infoactivity.com 
eCRM application 
------------------------------- 


_______________________________________________ 
Javascript mailing list 
Javascript at LaTech.edu 
http://www.LaTech.edu/mailman/listinfo/javascript 



_______________________________________________ 
Javascript mailing list 
Javascript at LaTech.edu 
http://www.LaTech.edu/mailman/listinfo/javascript 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010514/53b6dfc2/attachment.htm>


More information about the Javascript mailing list