On Jun 5, 3:55 pm, Gaijinco <gaiji...@gmail.comwrote:
I'm getting used to JavaScript once more.
I want to change the value of a textfield (which I know how to do it)
and then "press" a submit button to process the form, but I want to do
it when a user checks a check button.
Is there anything to do something like that?
Thanks.
Sounds like you want to synthetically generate an event. I don't
recommend doing it that way.
You could do something like this...
<script type="text/javascript">
function submitform() {
var form = document.forms.myForm;
// do stuff with form here
form.submit();
}
</script>
<form action="" name="myForm">
<p><input type="checkbox" name="some_name" value=""
onclick="submitform();"></p>
<p><input type="submit" value="submitform();return false;"></p>
</form>
Peter