fo******@gmail.com a écrit :
Need help - I'm new to javascript. I need to create a URL based on a
textbox.
Idea is user enters a number into a text box then clicks button which
retrieves a link based on the number previously entered in the
textbox. Something like:
http://www.xyz123.com/constanttext/<number from box>/constant/
Any ideas?
How user could know which numbers are available ?
<select onchange="var k = this.options.selectedIndex;
if(k==0) {alert('choice in list');return}
location.href='http://www.xyz123.com/constanttext/'+
this.options[k].value+'/constant/';">
<option>Find next</option>
<option value="1">1</option>
<option value="214">2</option>
<option value="48">3</option>
</select>
With an input :
<input onchange="location.href='http://www.xyz123.com/constanttext/'+
this.value+'/constant/';">
<input name="false_button" type=button value="go">
or :
<form action="http://www.xyz123.com/constanttext/"
onsubmit="this.action += this.number.value + '/constant/';">
Enter a number here: <input name="number" type=text>
<input type=submit value="go">
</form>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé