"Lando Chez" <go********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hi
I want to create fileds on my form that can not be manually edited
through the UI of the form. Instead the (visible) content is changed
through changes on other parts of the form.
e.g. making a selection from a list changes the content of the field
mentioned above.
I don't know the html code to create such a field on my form. Can
anyone help me out?
<form name="myForm">
<input type="text"
name="readonlyInput"
value="The value"
defaultvalue="The value"
readonly="readonly"
onchange="this.value=this.defaultValue;">
</form>
The real problem is that this still does not guarantee that the end-user
can not change the content of this input. As a result, you can NOT
depend on the value in this input when it reaches the server. For
example, if you are calculating a total price based on unit price times
the number of units, you should re-calculate that on the server, even if
you are putting it the above readonly input for the benefit of the
end-user.
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq