passing the parent form on the onclick event to javascript function
- by user1051505
Hi I am trying to pass variables on the onclick event to a javascript function. I am trying the following way, I can't get the input value in the javascript function.(I am expecting an alert of 1.) Is it the right way of doing this? Please help.
<head>
<script>
function submit_value(form) {
alert(form.ip.value);
}
</script>
</head>
<table>
<tr>
<form>
<td>
<input id="ip" type="text" value="1">
</td>
<td>
<a href="javascript:;" onClick="submit_value(this)">Button</a>
</td>
</form>
</tr>
</table>