Read attribute (but not only value) from servlet

F

Ferro

On my HTML page I have
<input type='text' NAME='pippo' MYATTRIBUTE='xxx'>

Then, from my servlet, I'd like to read the VALUE (and for
this I use req.getParameterValues("pippo")), but I'd like
to read also MYATTRIBUTE value (that is "xxx").

How can I do it?
Thanks a lot.
Ferro.
 
W

William Brogden

Ferro said:
On my HTML page I have
<input type='text' NAME='pippo' MYATTRIBUTE='xxx'>

The HTML convention for <input tags is to use NAME and VALUE
attributes. You can't invent a new syntax and expect browsers to use it.

You should get a good HTML reference.
 
A

Adam Maass

Ferro said:
On my HTML page I have
<input type='text' NAME='pippo' MYATTRIBUTE='xxx'>

Then, from my servlet, I'd like to read the VALUE (and for
this I use req.getParameterValues("pippo")), but I'd like
to read also MYATTRIBUTE value (that is "xxx").

How can I do it?
Thanks a lot.
Ferro.

You can't.

You can, however, put an additional input into the form:

<input type="hidden" name="myattribute" value="xxx">


and now you can read the attribute named "myattribute" and get its value
"xxx."


-- Adam Maass
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top