Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Forms Name attribute and Value Attribute

Featured Replies

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>

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

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/ASP
document 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.