how do i change the value of an input field with jquery?
Posted
by Lina
on Stack Overflow
See other posts from Stack Overflow
or by Lina
Published on 2010-04-27T12:19:58Z
Indexed on
2010/04/27
12:23 UTC
Read the original article
Hit count: 260
jQuery
Hi, i'm trying to use jquery to change the value of an input text box, but it's not working, here is my code...
<form method="get">
<input id="temp" type="text" name="here" value="temp value" />
<input class="form" type="radio" value="1" name="someForm" /> Enter something
Here: <input id="input" type="text" name="here" value="test value" />
</form>
<script>
var cachedAjax = new Object();
$(document).ready(function () {
$('.form').click(function () {
var newvalue = $("#input").val();
$("#temp").val(newvalue);
$("input").val($(temp).val());
});
});
</script>
the value of the "#input" text box is not changing!!!!!! why is that??? what am i missing??? thanks a 10 million in advance
© Stack Overflow or respective owner