How to pass a textbox's value as a string

A

AAaron123

<input id="txtStart" type="text" name="txtStart" value="620 Rugter Street ,
Utica, NY,13501" style="width:150px;"/>

<input id="txtEnd" type="text" name="txtEnd" value="168 Genesee Street,
Utica, NY,13502" style="width:300px;"/>

<input id="btnFind" type="button" name="btnGetRoute" value="Find"
onclick="GetRoute(txtStart.value,'168 Genesee Street, Utica, NY,13502');"
style="width:200px;"/>

The question rtelates to the button. If I use for both argument a string
like I used for the second argument it works OK.



But when I try to use the values in the text boxes, like I show for the
first argument, I can't get it to work.

The routine in the head starts with

function GetRoute(start, end) {

alert(start);

alert displays "undefined"



I don't want to send a reference to the textbox.

I want to send the contents as a string.



Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top