> From: Brian Schott > > 1 Do I have to give give a name to a form in this case? > 2 Do I have to give give an id to a form in this case? > 3 Do I have to give give a name to a form input in this case? > 4 Do I have to give give an id to a form input in this case? > 5 What is an element: the form or the input?
The name attribute is used mainly for form submission - what gets sent to your server when you submit the form. It's also used for radio button grouping and things like that. The id attribute is used in CSS, and in DOM manipulation like the document.getElementById() call. Which you need, and on what element(s), depends on what you're doing. You may need both - and maybe a class attribute too. If you're using document.getElementById(), then of course you need an id on the element you want. If you're submitting a form, you need to work out what name attributes you need. The form and the input are both elements, just like everything in the DOM. You'll see the terms "HTML element" and "DOM node" used more or less interchangeably. > In Rossko's search references it seems that all forms -- > maybe not their inputs -- exist when onload occurs Any elements (forms, inputs, divs, whatever) in the HTML code for your page are created at the time the HTML source is parsed. The onload event is fired after all the HTML code is parsed and after all images and other supporting files are loaded. > but not in my case, I don't believe. The form only exists > after the user clicks on the map and opens a new marker. Yes, because that's when you create the form. How could it exist before that? Your input form is created by the openInfoWindowHtml() call, using the HTML code you pass into that function - and there is a delay after that before it's actually created. openInfoWindowHtml() returns (or may return) immediately, and then at some later time the infowindow is created using your HTML code. That's when the form and input elements come into existence. -Mike --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
