Submit Sets Form Action

[Total: 0    Average: 0/5]

When the form is submitted the action field is set.

Head Code:

<script>
var _ACTION="http://js-examples.com/";
function submitNow()
{
  document.form1.action=_ACTION;
  document.form1.submit();
}
</script>

Body Code:

<form action="" method=POST name=form1>
Input-1:<input type=text name=num1 value="something"><BR>
Input-2:<input type=text name=num2 value="else"><BR>
Input-3:<select name=sel1><option>1</option><option>2</option></select><BR>
<input type=button value="Submit" onclick="submitNow()">
</form>

Times Viewed: 5

Leave a Reply

Your email address will not be published. Required fields are marked *