PDA

View Full Version : dynamic link



wizkidweb16
05-04-2006, 11:17 PM
I made a form on a website that I am creating. How would I make it so that the text field that the user enters into adds into the link? I have given the coding for my form:


<form action="http://maps.google.com/maps" method="get">
<p>
<label for="saddr">Your Address</label>
<input type="text" name="saddr" id="saddr" value="" />
<input name="Submit" type="submit" value="Get Directions" target="_new" onClick="return frameBranding('http://maps.google.com/maps?saddr=' + saddr.text + '&daddr=744+Broad+Street+Newark+NJ', 'brand.htm', 'rows');"/>
<input type="hidden" name="daddr" value="744 Broad Street Newark, NJ" />
<input type="hidden" name="hl" value="en" />
</p>
</form>

Twey
05-04-2006, 11:43 PM
What's this frameBranding() thing? And... what link? There's almost certainly no reason to fall back onto ECMAScript here. If you just want to go to http://maps.google.com/maps?saddr=(stuff)&daddr=744+Broad+Street+Newark+NJ, there's an easier way:
<form action="http://maps.google.com/maps" target="_new" method="get">
<p>
<label for="saddr">Your Address</label>
<input type="text" name="saddr" id="saddr" value="" />
<input name="Submit" type="submit" value="Get Directions" />
<input type="hidden" name="daddr" value="744 Broad Street Newark, NJ" />
<input type="hidden" name="hl" value="en" />
</p>
</form>That's what GET encoding is all about.