RE: Java script problem using servlets
In order to activate the debugger : (IE) outils/options internet/avancees -Message d'origine- De : William Kaufman [mailto:[EMAIL PROTECTED]] Envoye : mercredi 25 juillet 2001 16:55 A : '[EMAIL PROTECTED]' 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: > 219365303CAFE SOLUBLE MAXWELL 100 G>3014680041687 >219365303CAFE SOLUBLE MAXWELL 100 G 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 " ", 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:[EMAIL PROTECTED]] > Sent: Wednesday, July 25, 2001 7:26 AM > To: '[EMAIL PROTECTED]' > 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 : > > > Liste des articles > > > 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() > > } > > > > > 4 articles trouves 219365303CAFE SOLUBLE MAXWELL 100 G>3014680041687 >219365303CAFE SOLUBLE MAXWELL 100 G 3014680008093275456007OT CAFE SOLUBLE MAXWELL 100 > G>3014680008093275456007OT CAFE SOLUBLE MAXWELL 100 > G CAFE SOLUBLE > MAXWELL 100 G>3014680041687275456007OT CAFE > SOLUBLE MAXWELL 100 > G CAFE SOLUBLE > MAXWELL 100 G>3014680008093219365303CAFE SOLUBLE > MAXWELL 100 > G > > value='Sélectionner' > onClick="majCode()"> > > > > > > > Michel COTE > Cooperateurs de Normandie Picardie > Tel : 232111086 > email : [EMAIL PROTECTED] >
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: > 219365303CAFE SOLUBLE MAXWELL 100 G>3014680041687 >219365303CAFE SOLUBLE MAXWELL 100 G 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 " ", 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:[EMAIL PROTECTED]] > Sent: Wednesday, July 25, 2001 7:26 AM > To: '[EMAIL PROTECTED]' > 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 : > > > Liste des articles > > > 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() > > } > > > > > 4 articles trouves 219365303CAFE SOLUBLE MAXWELL 100 G>3014680041687 >219365303CAFE SOLUBLE MAXWELL 100 G 3014680008093275456007OT CAFE SOLUBLE MAXWELL 100 > G>3014680008093275456007OT CAFE SOLUBLE MAXWELL 100 > G CAFE SOLUBLE > MAXWELL 100 G>3014680041687275456007OT CAFE > SOLUBLE MAXWELL 100 > G CAFE SOLUBLE > MAXWELL 100 G>3014680008093219365303CAFE SOLUBLE > MAXWELL 100 > G > > value='Sélectionner' > onClick="majCode()"> > > > > > > > Michel COTE > Cooperateurs de Normandie Picardie > Tel : 232111086 > email : [EMAIL PROTECTED] >
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 : Liste des articles 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() } 4 articles trouves 3014680041687 219365303CAFE SOLUBLE MAXWELL 100 G3014680008093275456007OT CAFE SOLUBLE MAXWELL 100 G3014680041687275456007OT CAFE SOLUBLE MAXWELL 100 G3014680008093219365303CAFE SOLUBLE MAXWELL 100 G Michel COTE Cooperateurs de Normandie Picardie Tel : 232111086 email : [EMAIL PROTECTED]