I’m trying to find a function in JavaScript that is called everytime when a <form> or <select> is created. Does anyone have a idea?
I want something like:
<body onload="jsFunction();">
More exactly, I need to make a <select> that will be included in many pages, and I want everytime this is loaded, to select one of it’s values based on a request variable. So the function that will make the selection must called from this included script and must be included in this script.
I’m using JSP on the server side
This makes no sense. Just set the whole
selectedattribute programmatically based on the request parameter. Here’s an example:or if you have it in a collection:
The same is true for normal inputs:
(the
fn:escapeXml()is there to prevent XSS attacks)