I have a link wich opens a the second page with links wich call a javascript function.
I have some problem with javascript.
i am two aspx page..
in my first aspx page contain the second aspx page name..
i am clicking the second page link the second page is opened..
but
i wrote the javascript finction in second page..
in this the function does not execute..
how to solve the problem.......
please help me..
first Page name.......form1
second page name....form2
form1.aspx
<input type="text" name="stationFrom" size="16" value="" onblur="return openStationFrom();" >
function openStationFrom()
{
window.open("../enquiry/form2.aspx?" & mstrSession & "&stnName="+escape(document.form1.stationFrom.value)+"&formName=Form1&fieldName=stationFrom&leftWidth=0","","dependent=yes,width=350,height=375,screenX=200,screenY=300,titlebar=no,scrollbars=auto,maximize=no");
}
form2.aspx
<input type="hidden" name="formName" value='Form1'>
<input type="hidden" name="fieldName" value='stationFrom'>
<select name="stationNameCode" size=5 >
<option value='voter id(vt)'</option>
<option value='passport(PO)"option>
</select>
<input type="button" value="GO" onclick=" return setStationField()">
function setStationField()
{
if(document.form2.stationNameCode.selectedIndex<0)
{
alert("Please Select The Station From The List");
return false;
}
formName = document.form2.formName.value;
fieldName = document.form2.fieldName.value;
window.opener.document.forms[formName][fieldName].value = document.form2.stationNameCode[document.form2.stationNameCode.selectedIndex].value;
window.close();
}
this is my used source code..
my problem is..
i am click form2.aspx in GO button ..
i want to click the go button the form2 stationNameCode.selected index value go to form1.aspx to stationFrom text box..
i want to pass form2.selected index to form1.aspx
please help me.. how to do....