I have an Input text box thus….
<input id=“Input1” style=“width: 99px” type=“password” language=“javascript” />
and a hyper link
<a ID=“HyperLink1” href=“Management1.aspx?CMD=” ’ + Input1.value + “’”>HyperLink</a>
All I want to do is pass the value of Input1 as a variable to the Command CMD in Management1.aspx. I can’t seem to form the syntax right for Input1.value, it remains blank.
On further thought, I think you’re crediting JavaScript with more than it actually does.
“Input1.value” doesn’t get populated until you’ve told JavaScript to write that value to the hyperlink. And to extract that value from the text field, you need an event - onFocus or onBlur. Extracting the value requires a function too. Then you need to write to the HREF - which in itself it quite involved.
There’s an excellent tutorial about forms starting here that should help you.
If you really want to use a link rather than a form submit button, then you can use some Javascript to make the hyperlink submit the form behind the scenes:
Finally, if you really don’t want to use a form, you could do some DOM manipulation to dynamically add the form value to a real link. But I suspect that’s a tad overkill for your purposes.