I am trying to use jquery to change the value of an input text field, but it does not work, 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>
$(document).ready(function () {
$('.form').click(function () {
var newvalue = $("#input").val();
$("#temp").val(newvalue);
$("#input").val($("#temp").val());
});
});
</script>
the value of the text field "#input" does not change !!!!!! Why is this??? what am I missing ??? thanks to 10 million postscript in advance, the value of the text field is changing, but the input value attribute is NOT! even if I write ...
var value = $("#temp").val();
$("#input").attr("value", value);
source
share