sahanz
asked on
Copy what user types in a text filed in to a hidden field
In my page I have a text field <input type="text" name="txt" /> So what I want is, I want to add what user types in this filed in to a hidden field realtime, Would be gr8 if can be done using jquery
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
jQuery - something like :
<form>
<input type="hidden" name="htext" id="htext" value="" />
</form>
<form>
<input type="text" name="txt" id="txt"/>
</form>
$("#txt").bind("keyup", function() {
$("#htxt").val($(this).val ())
});
<form>
<input type="hidden" name="htext" id="htext" value="" />
</form>
<form>
<input type="text" name="txt" id="txt"/>
</form>
$("#txt").bind("keyup", function() {
$("#htxt").val($(this).val
});
Other form, no jQuery:
<form>
<input type="hidden" name="htext" value="" />
</form>
<form>
<input type="text" name="txt" onKeyUp="document.forms[0] .htext.val ue=this.va lue" />
</form>
[0] denotes the FIRST (0th) form
<form>
<input type="hidden" name="htext" value="" />
</form>
<form>
<input type="text" name="txt" onKeyUp="document.forms[0]
</form>
[0] denotes the FIRST (0th) form
ASKER
Thanks
ASKER