I’m fairly new on ASP and Javascript programming, I have read as much as I can to develop my website in a user friendly manner. I’m using javascript to pass some values in a Form, but is no working, I have tried to research, but being such a specific problem I haven’t being able to find any answers. Hope Somebody Can Help Me or put me in the right direction. Thanks in advance.
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:
[Code=javascript]
function passAirport(air port,formName,f ormField) {
var valuePath = eval("window.op ener.document." + formName + "." + formField);
valuePath.value = airport;
window.close();
}[/code]
You can view the 2 pages at ViajeroFrecuent e dot NET/Compra.html. When you click in the B/W airplane image, another page (Aeropuertos_Sp a.asp) opens, expecting you to select a city from the list. My goal is to pass the selected city/airport value back to the field (Origen) in the form on the previous page and close the window automatically.
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:
[Code=html]
<td align="right">< a href="javascrip t: MM_openBrWindow ('Aeropuertos_S pa.asp?FldName= Origen','','scr ollbars=yes,wid th=775,height=7 00')"><img src="/images/Icons/Aeropuerto.gif" alt="Seleccione Aeropuerto" width="16" height="16" border="0"></a>[/code]
And here is the code section on the Aeropuertos_Spa .asp page for the first airpot at the top.
[Code=html]
<a href="javascrip t:passAirport(' Aberdeen, SD (ABR)', 'travelrequest' , '');" class="airport" >Aberdeen, SD (ABR)</a><br>[/code]
When I select teh value in the Aeropuertos_Spa .asp page it gives me the following error
Can anybody please explain what I am doing wrong? Am I missing some variable definitions?
PLEASE HELP !
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:
[Code=javascript]
function passAirport(air port,formName,f ormField) {
var valuePath = eval("window.op ener.document." + formName + "." + formField);
valuePath.value = airport;
window.close();
}[/code]
You can view the 2 pages at ViajeroFrecuent e dot NET/Compra.html. When you click in the B/W airplane image, another page (Aeropuertos_Sp a.asp) opens, expecting you to select a city from the list. My goal is to pass the selected city/airport value back to the field (Origen) in the form on the previous page and close the window automatically.
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:
[Code=html]
<td align="right">< a href="javascrip t: MM_openBrWindow ('Aeropuertos_S pa.asp?FldName= Origen','','scr ollbars=yes,wid th=775,height=7 00')"><img src="/images/Icons/Aeropuerto.gif" alt="Seleccione Aeropuerto" width="16" height="16" border="0"></a>[/code]
And here is the code section on the Aeropuertos_Spa .asp page for the first airpot at the top.
[Code=html]
<a href="javascrip t:passAirport(' Aberdeen, SD (ABR)', 'travelrequest' , '');" class="airport" >Aberdeen, SD (ABR)</a><br>[/code]
When I select teh value in the Aeropuertos_Spa .asp page it gives me the following error
Can anybody please explain what I am doing wrong? Am I missing some variable definitions?
PLEASE HELP !
Comment