Garg Sanjay wrote:
> Hi all,
>
> I was wondering whether the form element's values are directly
> visible to the JSP scriptlet within the same page. For example
> say I have a ComboBox and onChange event for the combo I want
> that the JSP scriptlet within the JavaScript should be able to
> see the selected combo item's value.
> Is it possible. I would appreciate any input.
>
No it's not, because of the timing of what is going on.
The JSP page (including it's scriptlets) are compiled into a servlet that is
executed on the server when the page is requested. By the time you see the page,
all of that code has already been executed.
The "onChange" event handler, on the other hand, happens inside your browser
client, and can execute any JavaScript code (not JSP scriptlet) that you include in
the page. From this JavaScript code, the currently selected item is indeed
available -- one of the JavaScript oriented web sites should have examples of the
precise syntax.
>
> Regards,
> Sanjay
>
Craig McClanahan
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html