Hi I have a form that has several inputs.
I have the user entering three of these to start with and then I have an OnChange="ComposeGMQ()" on the third which loads up an iFrame using the three inputs as part of its URL.
So far so good.
Now once this is done I want the focus to return to the 4th input on the original form.
My code is....
I think that the iform is not finished loading and the focus is being executed.
Any help appreciated
I have the user entering three of these to start with and then I have an OnChange="ComposeGMQ()" on the third which loads up an iFrame using the three inputs as part of its URL.
So far so good.
Now once this is done I want the focus to return to the 4th input on the original form.
My code is....
Code:
function ComposeGMQ()
{
[blue]//get journey points...
//convert them to UpperCase...[/blue]
GMQ = "[URL unfurl="true"]http://maps.google.com/maps?daddr="[/URL] +
[blue]...the journey points and other params required by GoogleMaps
//next line used to open a new browser window to display Google Maps[/blue]
//win = window.open(GMQ, "js");
[blue]//I now display this within an Iframe whoes elementID is GMA[/blue]
document.getElementById("GMA").src= GMQ
[red]Fine up to this point[/red]
[blue]//if I use this line the Focus just goes to the first input box in the iFrame and not the 4th input in the form - no error given[/blue]
document.getElementById("DistanceInput2").focus()
[blue]//using the line below gives me an error 'is null or not and object - qquote3 is the ID for the Form and DistanceInput2 is the ID of the 4 input.[/blue]
document.qquote3.DistanceInput2.focus()
}
I think that the iform is not finished loading and the focus is being executed.
Any help appreciated