is it possible to read an attribute from a form element?
I got this:
<input class="number required" min="1250" max="999999999" id="insert_counter1" name="my_counter" value="" type="text">
After submit I can access the value. But is there any way to get to the other attributes like "min" or "max"?
Right now I have a hidden readonly input field named my_counter_min where the "min" attribute is stored. I do not know if that is a work-a-round or if it actually is the only way to do it.
Br. Anders
UPDATED based on answers below:
Thanks for good feedback. As I read the answers there are three good solution with some pros and cons.
- Store value in input type=hidden. Easy to do, but can be tampered with
- Use parser. Takes more time to code but original value will be fetched through a new web request. So no tampering
- Store value in DB. If the form is related to a specific rcord in the DB then storing extra values can make good sence and will not cost a lot of coding effort if other values have to go into and out of the DB allready (just add a value).
I got three different answers for my question. Fastest answer marked correct even though there are more than this one solution.
BR. Anders