Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble getting a variable value into a form field 1

Status
Not open for further replies.

ttflyer

MIS
May 7, 2003
3
US
I've been playing with google's map api and wanted to combine it with a submission form to include lat & long of map coordinates with the form submission.

So far it all works except grabbing the variables and sticking them in a text field. I can get them to show up on an alert (for testing only) but not in the form field. It's probably something stupid since I'm not as familiar with Javascript as a should be.

Rather than post the code here, you can see the source at a prototype page:

Any help from this knowledgeable group would be greatly appreciated !
 
You don't appear to have a form named 'mapForm' in your HTML. A line such as document.mapform.latitude.value = latval; explicitly looks for one. Change to document.forms[0].latitude.value = latval; or document.FrontPage_Form1.latitude.value = latval; and try again.

'hope that does it.

--Dave
 
Thanks! that points to the problem!
I was looking at the source in FrontPage. Big Mistake! It shows "mapform" after a save but it really isn't there! You are 100% right. It defaults back to Form_1, I just wasn't looking at the finished product.
FrontPage Sucks. Glad I just bought Dreamweaver.
Thanks again!
 
You're welcome. I'm glad that helped. Thanks for the star!

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top