April 3, 201313 yr Dear Web Designer Forum, I am trying to wrap my head around html forms. I understand most of it but just want to make sure I have all my facts straight. For the form shown below I wanted some clarification on the "name" attribute. If I am correct the name attribute is what will show up in the submitted form that you recieve in email from end user right? For example if I were reading the submitted form shown below in my email it would show the word "fullname" next to value the user put in form right? My other questionis about the radio input type. Does the name attribute show up in email along with the value attribute? Or does the text "UK" show up? <form> First Name: <input type="text" name="fullname"> Where are you located?: <input type="radio" name="location" value="London">UK<br> <input type="submit" value="submit"> </form>
April 3, 201313 yr Hi mate! There is a reasonably good explanation over at w3schools http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_name Whatever scripting language you use will process the form server side & return the values To answer the second part of your question again you can see a ref over at w3schools http://www.w3schools.com/html/html_forms.asp e.g. <form><input type="radio" name="sex" value="male">Male<br><input type="radio" name="sex" value="female">Female</form> The value Male or Female will be returned
April 4, 201313 yr Hi. The name attribute is not "what will show up in the submitted form" it's often used as an identifier for the script that processes the form. You will typically use server side scripting like PHP or ASP to process your form. You will then need an “action attribute” to point to the PHP/ASP document. In order to pass the content from the unique form field to the PHP/ASPdocument you can use the name attribute. That’s what the name attribute is typically used for in forms. Hope this was helpful.
Create an account or sign in to comment