tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zze-messager FTM balr002 <messagerftm.balr...@rd.francetelecom.com>
Subject RE: Java script problem using servlets
Date Wed, 25 Jul 2001 15:05:41 GMT
In order to activate the debugger : 
(IE) outils/options internet/avancees


-----Message d'origine-----
De : William Kaufman [mailto:WKaufman@viquity.com]
Envoye : mercredi 25 juillet 2001 16:55
A : 'tomcat-user@jakarta.apache.org'
Objet : RE: Java script problem using servlets


First question: Did you try running this in a browser debugger?  MS has one
for IE (search for "JScript debugger"), and Netscape 4 has one.

> parent.document.critere

document.critere isn't defined, unless you're defining it somewhere else.

And, is this actually, really the HTML you're using?  You've got this option
in there:

>   <option value= 3014680041687 
>    2000019365303    CAFE SOLUBLE MAXWELL 100 G>3014680041687 
>    2000019365303    CAFE SOLUBLE MAXWELL 100 G</option>

You need to quote the value.

You should also realize that the text outside the tags is never going to
line up the way you want.  You might want to replace the blanks with
"&nbsp;", and set the style to "font-family: monospace;".  Or, replace the
whole thing with a table and add some radio buttons to do selection.

                                        -- Bill K. 

> -----Original Message-----
> From: Michel COTE [mailto:michel.cote@coop.fr]
> Sent: Wednesday, July 25, 2001 7:26 AM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: 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_li
> ste_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
> 

Mime
View raw message