Submit Alternates Target URL

[Total: 0    Average: 0/5]

This shows how to have a form submit button alternate the target of its submit.

Body Code:

<form name=exf1>
<input type=text name=t1 value="">
<input type=text name=t2 value="">
<input type=hidden name=which value="1">
<input type=button value="Go!" onclick="goNow()">
function goNow() {
var x = document.exf1.which.value!="1"?"1":"2";
var y = eval("document.exf1.t"+x+".value");
alert("going to "+y);

Times Viewed: 0

Leave a Reply

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