May have in a web page HTML or HTML 5,... 3 DIV BLOCKS within each a <form> etc tags, with same IDs(per BLOCK), but in a time one only display:block the other two display:none (in a time)... can have this many IDs the same???
May have in a web page HTML or HTML 5,... 3 DIV BLOCKS within each a <form> etc tags, with same IDs(per BLOCK), but in a time one only display:block the other two display:none (in a time)... can have this many IDs the same???
I'm not completely sure what you are asking. If I understand correctly, NO, elementid
attributes must be unique. Only one element may have any given id; display/visibility doesn't matter.
If this is not what you are asking, please explain your question more clearly.
YES THAT MEAN... Well i have to use other Technics, so as IDs must be unique ALL either in display:none/block, like other client or server techniques... process one form from 3 different forms(one visible), like in a rent a car project having:
booking confirm page after a quote:
book without Register
book and Register
book and Social Register
correct?
Will you only process one of the three forms?
Will you *ever* need to process more than one at the same time?
If they are exclusive (meaning you'll only ever process one of the three), then you can give the forms / form inputs the samename
attributes (names can be the same; ids can not).
another option would be to simply have one form, and hide the inputs you don't need. for example (IIUC),
HTML Code:<form id="myform"> <fieldset id="booking"> <legend>Booking</legend> <p>This section is always visible.</p> <label>book: <input name="book"></label> </fieldset> <fieldset id="register"> <legend>Register</legend> <p>This section is visible if the user is going to register, and hidden otherwise.</p> <label>register: <input name="register"></label> </fieldset> <fieldset id="social-register"> <legend>Social register</legend> <p>This section is visible if the user is going to "social" register, and hidden otherwise.</p> <label>social: <input name="social"></label> </fieldset> <label>Submit the form: <input type="submit" name="myform-submit" value="submit"> </label> </form>
yes since all results are a booking,... only one form used ever and processed....
if instead of "id" use "name" (PHP looks "name" attribute only in Post super global correct?) then in javascript use getElementByName("nameAttributeValue').value, correct?
correct
you *could*, but since names are not unique, you'd need to figure out which one you want (since getElementsByName returns a list, not an individual item).
You can use ids and names together - use the id for javascript functionality, and use the name for processing the form in PHP.
is any way use keyword this with form.nameAttribute.value to get value?
Bookmarks