You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michel COTE <mi...@coop.fr> on 2001/07/25 16:26:00 UTC

Java script problem using servlets

Hello,

I'm using Jakarta since a few days and i encounter the following  strange 
problem :

I have build a sample servlet based page that contains two frames, one 
(issued from a servlet) with a sample form composed of a dynamic list 
(created with a JDBC SQL query) and a push button, and another one composed 
of a static html file (not coming from a servlet) including only a text 
field.

I just want to copy the value content of the selected list item, in the 
text field by clicking the button.
So i use a sample " onClick " java script function on the button that reads 
the value in the list and write into the text field. Then i allways get a 
java script error message " Permission denied ".

When i replace the servlet HTML part in the first frame by exactly the SAME 
HTML STATIC code  (not issued from a servlet but directly from an html 
file), everything works fine ! ! ? ?

Have you ever eard about such a matter ? ? ?

Thanks for any help.

Michel COTE.

Here is a copy of the HTML code in the first frame :

<HTML>
<HEAD><TITLE> Liste des articles </TITLE></HEAD>
<BODY  topmargin='0'>
  <script language='JavaScript'>
function majCode()
{
//The java script allways hangs on this line

parent.document.critere.text_field.code.value=document.form_liste_art.li  
ste_articles.value.substring(0,12)

parent.close()

}
</script>
<form name='form_liste_art' >
 <div align='center'>
<select name='liste_articles' size='13'>
<option>4 articles trouves </option><option value= 3014680041687 
   2000019365303    CAFE SOLUBLE MAXWELL 100 G>3014680041687 
   2000019365303    CAFE SOLUBLE MAXWELL 100 G</option><option value= 
3014680008093    2000075456007    OT CAFE SOLUBLE MAXWELL 100 
G>3014680008093    2000075456007    OT CAFE SOLUBLE MAXWELL 100 
G</option><option value= 3014680041687    2000075456007    OT CAFE SOLUBLE 
MAXWELL 100 G>3014680041687    2000075456007    OT CAFE SOLUBLE MAXWELL 100 
G</option><option value= 3014680008093    2000019365303    CAFE SOLUBLE 
MAXWELL 100 G>3014680008093    2000019365303    CAFE SOLUBLE MAXWELL 100 
G</option></select>
</select>
<br><br><input type='button' name='bt_select' value='S&eacute;lectionner' 
onClick="majCode()">
</div>
</form>
</body>
</html>


Michel COTE
Cooperateurs de Normandie Picardie
Tel : 232111086
email : michel.cote@coop.fr