Jump to content

Pass on text in forms


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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...