Jump to content

Pass on text in forms


heisann999

Recommended Posts

I'm not very experienced in html.

 

Is there a way to pass on text that is shown as a part of a form (not text that the user fill in, but text written by the programmer in the html-file), without having to write it as "value" in addition?

 

I've checked the W3Schools.com, and tried to search google as well, but I can't find any information on this.

 

I know I can do something like this:

 

<td>Verb1<input type="hidden" name="Verb1" value="Verb1"></td>

 

But is there a way of doing this without having to write the same twice in the html-coding?

 

 

Link to comment
Share on other sites

The op wants the name attribute value, WITHOUT the need to fill in the value with the same name attribute value.

 

You should be able to on form submission to create cookie, or save to web storage the name attribute value using JavaScript.

 

But seems pointless as you will know what they will be so you can preempt this in next page.

Link to comment
Share on other sites

The op wants the name attribute value, WITHOUT the need to fill in the value with the same name attribute value.

 

You should be able to on form submission to create cookie, or save to web storage the name attribute value using JavaScript.

 

But seems pointless as you will know what they will be so you can preempt this in next page.

 

What they actually want is to store the value in an input while also displaying it to the user. The fact that the name of the input and its value are the same is just a mistake in the example code.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...