OOPS, Since the "name" field was at the top it was the one I was testing with, and it turned out that was the only one with an issue. Must have something to do with using "name" as the name...
For some reason the input tags in my form are not updating the value attribute when they are changed view the actual element (not JavaScript). The data posted to the server is the original value of the "value" attribute, not the text in the textbox.
The textareas in the form work fine, and I have checked javascript fired "onchange" and I can't find any... Help please!
Here is the HTML:
<form action="" method="post">
<div id="group-1" class="group case">
<a class="heading open">heading</a>
<input name="editform[0][class]" value="case" type="hidden">
<input name="editform[0][id]" value="2" type="hidden">
<div class="field">
<label>Name</label>
<input class="text" name="editform[0][name]" value="Mike Escarcaga" type="text" >
</div>
<div class="field">
<label>Title</label>
<input class="text" name="editform[0][title]" value="General Manager" type="text" >
</div>
<!-- repeated for each field -->
<div class="field" >
<label >Text</label>
<textarea class="ltext" name="editform[0][text]" >
Blah HTML, and more blah...
</textarea>
</div>
</div>
<!-- repeated for each group in the form (editform[1], editform[2], etc.) -->
</form>
The value attribute contains the default value for an input, not the live value.
The DOM value property contains a live value.
Agree With @Quentin Dom Contain Live Value and HMTL Input contain Default Value for an input So for Changing the Default Value of the input use This Javascript Trick
document.getElementById("myText").defaultValue = "Goofy";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With