I have a form and when clicking on an image all I’m trying to do is select the airport name and code from another ASP page. I have a javascript function in a .js file:
Expand|Select|Wrap|Line Numbers
- function passAirport(airport,formName,formField) {
- var valuePath = eval("window.opener.document." + formName + "." + formField);
- valuePath.value = airport;
- window.close();
- }
My form name is travelrequest, the first field that I’m trying to make it work is Origen, the one mark with “*” as it is a required field. Here is the code section on the Compra page:
Expand|Select|Wrap|Line Numbers
- <td align="right"><a href="javascript: MM_openBrWindow('Aeropuertos_Spa.asp?FldName=Origen','','scrollbars=yes,width=775,height=700')"><img src="/images/Icons/Aeropuerto.gif" alt="Seleccione Aeropuerto" width="16" height="16" border="0"></a>
Expand|Select|Wrap|Line Numbers
- <a href="javascript:passAirport('Aberdeen, SD (ABR)', 'travelrequest', '');" class="airport">Aberdeen, SD (ABR)</a><br>
Can anybody please explain what I am doing wrong? Am I missing some variable definitions?
PLEASE HELP !