Select Changes Action

[Total: 0    Average: 0/5]

The select list choice sends a user to a defined page.

Head Code:

<script>
var LOC=new Array();
    LOC[101]="http://js-x.com/";
    LOC["abc"]="http://js-world.com/";
function doIt(_obj)
{
  var _return=false;
  var x;
  if(x=LOC[_obj.t1.value])
  {
    _obj.action=x;
    _return=true;
  }
  return _return;
}

Body Code:

<form onsubmit="return doIt(document.f1ex)" name=f1ex>
<input name=t1>
<input type=submit>
</form>
<HR>
<div>
101 -> http://js-x.com/<BR>
abc -> http://js-world.com/
</div>

Times Viewed: 0

Leave a Reply

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