Must I always have to add name and id attributes in form input tags?
-
Isn't just the "id" enough?
-
Answer:
The "id" tag is used by CSS and JavaScript to assign styles and act on the input item. Libraries like jquery use the id as a shortcut identifier, so it's generally useful to set. The "name" attribute of a form element is what actually gets sent by your web browser in the HTTP GET or POST submission/request to the web server. If you leave it blank, you won't have a proper identifier tied to your content. You may, however, be using JavaScript to submit your forms via AJAX, meaning that you never send form variables via GET or POST through direct web browser submission. In that case, the name field is unnecessary, although it's not great convention.
Joe Emison at Quora Visit the source
Related Q & A:
- What framework must I use to develop mobile native application?Best solution by Stack Overflow
- How do I change my WiFi SSID name and add a password?Best solution by Yahoo! Answers
- Why must I change my password every day?Best solution by Yahoo! Answers
- What must I do to get into UCLA?Best solution by Yahoo! Answers
- What type of fuel must I put in my scooter? LRP or unleaded?Best solution by answers.yahoo.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.