Button Creates Popup with Selection

[Total: 0    Average: 0/5]

This will take the input selected from the user and create a popup window.

Body Code:

<script>
/*
 * This script is only to test that a parameter was sent.
 * This example posts the data to itself and shows you the data
 */
var _varPassed,_valPassed;
var _temp = document.location.search;
 if(_temp) _temp=_temp.split("?")[1];
 if(_temp)
 {
   _varPassed=_temp.split("=")[0];
   _valPassed=_temp.split("=")[1];
 }
if(_varPassed)
  document.write("Variable Name: "+_varPassed+"<BR>It is: "+_valPassed);
else
  document.write("Choose");
</script>

<script LANGUAGE='JavaScript'>
var _html = "http://www.your_site.com"; /* this is the page that it has a popup */
    _html = document.location.toString(); /* I used this for testing on my PC */
    var _dl1=_html;
    var _dl2=_dl1.indexOf("?");
	var _dl3=_dl1.substr(0,_dl2);

var YES=false;
function customize(_form,_value)
{
  var item  = eval("_form.test"+_value+".value;");
  var option = 'toolbar=0,location=1,directories=0,status=0,menubar=0,scrollbars=0,op_scroll,resizable=0,width=400,height=400';
  if(!YES)
  {
    win4 = window.open(_dl3+'?var='+item, 'what_I_want',option);
    win4.focus();
    win4.document.YES=true;
  }
  else
  {
    document.location=_dl3+"?var="+item;
	self.focus();
  }
}
</script>

<HR>

<FORM>
<input type='hidden' value='one' name='test1'>
<INPUT TYPE='button' VALUE='1' OnClick='customize(this.form,this.value)'>

<input type='hidden' value='two' name='test2'>
<INPUT TYPE='button' VALUE='2' OnClick='customize(this.form,this.value)'>

<input type='hidden' value='three' name='test3'>
<INPUT TYPE='button' VALUE='3' OnClick='customize(this.form,this.value)'>

<input type='hidden' value='four' name='test4'>
<INPUT TYPE='button' VALUE='4' OnClick='customize(this.form,this.value)'>
</form>

Times Viewed: 6

Leave a Reply

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