I should also mention, you can certainly do something like this:
<script>
function changeIt() {
myForm.myField.value = "<%=someValue%>";
}
</script>
...but that's not much different than just setting the value of the
field with a scriplet. However, if you perhaps have some discrete
values that you want to be able to change the field to, like maybe
something like a "previous value" button, and you have the value at the
time the JSP is interpreted, you can do this and just call changeIt() in
response to onClick() of the button. That's something of a hybrid.
Frank
Frank W. Zammetti wrote:
You might not be asking this, but...
Scriplets execute on the server, not on the client. The results of a
scriplet are in essence "inserted" into the response.
So in that regard, no, you can't use a scriplet to change the value of a
text field as you would with Javascript because Javascript executes on
the client *AFTER* the response has been completely rendered and
returned to the broser, while a scriplet executes *WHILE* the response
is being rendered and *BEFORE* it is returned to the client.
Does that answer the question, or did I misinterpret?
Frank
Cassius V. de Magalhaes wrote:
Hello,
I would like to change the value of a form's text field by scriplet,
is it possible, please?
Through Javascript, I can use the form name plus the name of the
field, for example,
"myform.address.value='xxx'". I know I can do
"myform.address.value='<%= something %>'", where "something" is a
scriplet variable declared previously. Is it possible to change the
value of a form field inside of a scriplet
just as we can by a javascript code, please?
TIA,
Vinicius.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
.
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]