Hi

I have a select object inside a form displaying several items. In the
OnChange event I call this script function, which
is supposed to change 3 input text objects depending on the selected item.
The value of these 3 text objects is obtained searching in a database tru
the JSP interface (id is the id of a Java Bean)
The script gives an error because the i iterator variable of the JSP
functions is not known to the JavaSript i variable
So, how can I access the list of the id Java Bean tru the JavaScript cycle ?
Doing a switch for each case won�t do, because the list can grow
dynamically.
And afecting some Bean variable tru the JavaScript wont�do do either,
because the assigment is only, as far as I know,
in the direction Bean ---> javascipt

Thanks

<script language="JavaScript1.1">
function goThere() {
 var list = document.forms[0].utilizadores
 strValue = list.options[list.selectedIndex].text
 for (i = 0; i < <%= id.getSizeUsers() %>; i++) {
  if ( strValue == <%= id.getUsersNome(i) %> ) {
   document.forms[0].departamento.value =  <%= id.getUsersDepartamento( i )
%>
   document.forms[0].telefone.value =  <%= id.getUsersTelefone( i ) %>
   document.forms[0].fax.value =  <%= id.getUsersFax( i ) %>
  }
 }
}
</script>



</Pedro Vicente>
--------------------------------------------------------------
<[EMAIL PROTECTED]>          http://www.ccmp.inesc.pt
INESC - Instituto de Engenharia de Sistemas e Computadores
Rua Alves Redol n� 9, 7 Dto. 1000 Lisboa     -    Portugal
Tel: +351 21 310 0245                Fax: +351 21 310 0445
--------------------------------------------------------------
Home
http://hidrox.ist.utl.pt/maretec/vicente/vicente.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to