114
rated 0 times
[
121]
[
7]
/ answers: 1 / hits: 46541
/ 12 Years ago, fri, january 11, 2013, 12:00:00
I wanted to know if there was a way I could adapt this code so that when the submit button was clicked, it would disappear, but the input box would remain.
<script type=text/javascript>
var Text = 'hello';
function setInput(button) {
var buttonVal = button.name,
textbox = document.getElementById('input_' + buttonVal);
textbox.value = Text ;
}
</script>
<html>
<input class='input' id=input_a1 name=a1 value=<?php {echo $a1;} ?>>
<input type='submit' name='a1' value='x' onclick='setInput(this); return false;'>
</html>
More From » html