Re: [OT] Re: Javascript problem

2008-02-11 Thread Pablo Vázquez Blázquez
Hi Jeromy, Thanks for your explanation. Now, my problem has a reason. Well, you say "The S2 implementation executes the scripts at the end of parsing, not as each script tag is encountered". At the end of parsing is before inserting html into the DOM, isn´t it? So, if it is so, that's my prob

[OT] Re: Javascript problem

2008-02-11 Thread Jeromy Evans
Just one minor clarification that hasn't been mentioned elsewhere in this thread. If your HTML fragment is being loaded via XHR with Dojo, then Dojo itself is responsible for parsing the html for scripts and then executing them. This is because inserting html into the DOM via innerHTML does n

Re: [OT] Re: Javascript problem

2008-02-11 Thread Laurie Harper
addOnLoad() should cause the function to be executed as soon as the DOM is complete, which may be before the page has finished loading and rendering. However, since the DOM will be fully constructed, getElementById() should work properly at that point. I'd go with Dave's advice and confirm that

Re: [OT] Re: Javascript problem

2008-02-11 Thread Pablo Vázquez Blázquez
If I use a hidden iframe to do the same, it works. I didn´t put the script tag in the . I don´t understand why I should do it... I´m using Tiles and my header is reused in several pages, and this script is only valid for few ones. Thanks. Dave Newton escribió: --- Pablo Vázquez Blázquez <[EMA

Re: [OT] Re: Javascript problem

2008-02-11 Thread Dave Newton
--- Pablo Vázquez Blázquez <[EMAIL PROTECTED]> wrote: > > function init() { > alert(document.getElementById('name[0]')); > } > > dojo.addOnLoad(init); > > > It is the same as: > > > alert(document.getElementById('name[0]')); > > > It is executed before the pag

Re: [OT] Re: Javascript problem

2008-02-11 Thread Lukasz Lenart
Did you put such code inside page header's tags? Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [OT] Re: Javascript problem

2008-02-11 Thread Pablo Vázquez Blázquez
function init() { alert(document.getElementById('name[0]')); } dojo.addOnLoad(init);


It is the same as:


   alert(document.getElementById('name[0]'));


It is executed before the page loads.

Dave Newton escribió:

--- P

Re: Javascript problem

2008-02-11 Thread Pablo Vázquez Blázquez
Thanks Dave. I had already written this post before seeing your other response. I´ll try dojo.addOnLoad(fn). Dave Newton escribió: --- Pablo Vázquez Blázquez <[EMAIL PROTECTED]> wrote: What I want is to execute my js after the page is loaded (so, the normal behabiour), not while it is load

Re: Javascript problem

2008-02-11 Thread Dave Newton
--- Pablo Vázquez Blázquez <[EMAIL PROTECTED]> wrote: > What I want is to execute my js after the page is loaded (so, the normal > behabiour), not while it is loading. "window.onload" does not execute while the page is loading; that wouldn't make any sense: it executes after all page-related req

[OT] Re: Javascript problem

2008-02-11 Thread Dave Newton
--- Pablo Vázquez Blázquez <[EMAIL PROTECTED]> wrote: > Anyone knows why my javascript code is executed at the loading of a page > instead when it *should*?? Mostly because of your definition of "should" ;) > For example, I have a .jspx page with a form: > > ... > > ... > > > >

Re: Javascript problem

2008-02-11 Thread Pablo Vázquez Blázquez
What I want is to execute my js after the page is loaded (so, the normal behabiour), not while it is loading. And I would like to add my javascript behaviour when necessary (on demand, no in page header). Is it possible? I have always done so but now with dojo and struts 2. Lukasz Lenart escri

Re: Javascript problem

2008-02-11 Thread Lukasz Lenart
Try to put your JavaScript in page header and use onload window.onload = function() { alert('hi'); alert(document.getElementById('id')); } Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart - To unsubscribe, e

Javascript problem

2008-02-11 Thread Pablo Vázquez Blázquez
Hi! Anyone knows why my javascript code is executed at the loading of a page instead when it *should*?? For example, I have a .jspx page with a form: ... ... alert('hi'); alert(document.getElementById('id')); 'hi' is shown before the form and then 'undefined'. But my js

Re: Javascript problem, how to control special characters from being entered into textbox

2006-06-27 Thread Frank W. Zammetti
CII values with the character entered on OnKeyUp event. If it's a >> special >> character, just drop it. >> >> You can also use java.util.regex.Pattern and >> java.util.regex.Matcherclasses >> at server side. >> >> >> -Original Message-

Re: Javascript problem, how to control special characters from being entered into textbox

2006-06-27 Thread Monkeyden
June 27, 2006 2:29 PM To: Struts Users Mailing List Subject: Javascript problem, how to control special characters from being entered into textbox Hi, I hava a javascript problem. I need to restrict anyone entering special characters into a textbox which is there in my html. I know that i can us

RE: Javascript problem, how to control special characters from being entered into textbox

2006-06-27 Thread Mukta
gex.Pattern and java.util.regex.Matcher classes at server side. -Original Message- From: Medicherla Lakshmi [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 2:29 PM To: Struts Users Mailing List Subject: Javascript problem, how to control special characters from being entered into textb

Javascript problem, how to control special characters from being entered into textbox

2006-06-27 Thread Medicherla Lakshmi
Hi, I hava a javascript problem. I need to restrict anyone entering special characters into a textbox which is there in my html. I know that i can use onKeyPress event to handle this, but for this i need to know the keycodes. Please anyone tel me if there is any other way to handle

Re: regarding javascript problem

2005-06-22 Thread Nitesh
You could use the onsubmit of the form tag as well... --- HTH Nitesh - Original Message - From: "Khan" <[EMAIL PROTECTED]> To: Sent: Thursday, June 23, 2005 10:30 AM Subject: regarding javascript problem Hi, I have problem in submiting

regarding javascript problem

2005-06-22 Thread Khan
Hi, I have problem in submiting my form through javascript by onclick event, it say that this property cant be supported. The form gets submitted by button, no prob. Any idea how to proceed but through javascript only. My code: function delete(){ if(condition){ checking some validations }

Re: OT: Problem with checkbox - now javascript problem

2005-02-10 Thread Norris Shelton
having a checkbox with the same name as a hidden field prevented the value from being evaluated. This was solved by putting the script directly into the onclick method. onclick=" if (this.checked == true) { document.getElementById('${recordType.name}Box').style.display='block'; } else { do

Re: OT: Problem with checkbox - now javascript problem

2005-02-10 Thread Norris Shelton
Dang it. This is not going to work for me. I have a check box. If the check box is checked, I have some javascript looking for the click event. If the check box has a .checked = true. I change div's display value to block, else to none. So, you check the check box and some radio buttons show

Re: help : submit with javascript problem

2005-01-18 Thread Andrew Hill
Make sure you dont have any field or button whose id or name is also "submit" as in javascript a function is just another type of object, so a button or field on the form named 'submit' will hide the forms submit method and your call to frm.submit() would be trying to refer to the button which

help : submit with javascript problem

2005-01-18 Thread sachin
hi all , i have a Struts form defined like .. and i am tring to submit this form with javascript function like .. function submit() { frm=document.getElementById("paraFrm"); frm.submit(); } but it gives error that object does not support this p

Re: help : submit with javascript problem

2004-10-11 Thread calandraca
Try this: function callSubmit() { frm = document.getElementById("myFrm"); frm.submit(); } Note that styleId attribute in html:form tag will be rendered as an id html attribute (see Struts documentation). So you will have a way for locating the form from

Re: help : submit with javascript problem

2004-10-10 Thread Michael McGrady
Geesch! Wrong again -- I AM. He does have an but it is outside the form and used to submit the form. REALLY ODD! Why is he doing that? Michael McGrady Rick Reumann wrote: I do wonder in this case, however, whether you use buttons or rely on the auto-gui, why use "button" rather than "

Re: help : submit with javascript problem

2004-10-10 Thread Michael McGrady
Heh, Rick, I think we both misread what this gentleman is doing. I know I did. I missed that the button used to submit the form was outside the form. Why it is outside is not clear. But, he said it was. But, you seem to have missed that it was being used to submit the form. An odd situati

Re: help : submit with javascript problem

2004-10-10 Thread Rick Reumann
Michael McGrady wrote the following on 10/10/2004 10:09 PM: I do wonder in this case, however, whether you use buttons or rely on the auto-gui, why use "button" rather than "submit", if you want to submit? I might also say, that is what submit buttons are for. I assume, however, that there is

Re: help : submit with javascript problem

2004-10-10 Thread Michael McGrady
Hello, again, Rick, Thanks for the clarification. Your posts are always enlightening and informative. I mean that. I am not being sardonic in the slightest. I have to admit that I don't think they look bad either. However, they do greatly restrict the GUI team. I like my taste but I know t

Re: help : submit with javascript problem

2004-10-10 Thread Rick Reumann
I often use the regular html buttons for various things. Users are used to seeing these buttons so they know they can click on them. So for example someone might have a button "view logs" which doesn't necessarily submit a form but opens up a pop up window or maybe goes to some other url. Sure

Re: help : submit with javascript problem

2004-10-10 Thread Michael McGrady
Hi, RIck, I don't understand why this would make someone "make an image look like a form button". I am not sure what that means. All my form buttons are images. They look however I want them to look. I probably don't see what you are saying either. We may be coming from different directions

Re: help : submit with javascript problem

2004-10-10 Thread Rick Reumann
Michael McGrady wrote the following on 10/10/2004 4:42 PM: Wjau are you using button? Why not use image? What's the advantage of using an image in this case? Wouldn't this require someone to make an image to look like a form button? I'm probably missing something obvious here:) -- Rick

Re: help : submit with javascript problem

2004-10-10 Thread Michael McGrady
' token. If it still gives you errors give us the error log so it would be easier to Help you. Hope this helps, Erez -Original Message- From: sachin [mailto:[EMAIL PROTECTED] Sent: Saturday, October 09, 2004 5:29 PM To: Struts Users Mailing List Subject: help : submit with javascript pr

RE: help : submit with javascript problem

2004-10-09 Thread Erez Efrati
04 5:29 PM To: Struts Users Mailing List Subject: help : submit with javascript problem hello all , i have a struts form and a button outside the form. on button click , with javascript i need the submit the form any help is welcome. My code is like following. but does not work f

Re: help : submit with javascript problem

2004-10-09 Thread Erik Weber
Sorry, I'm not very good with JavaScript, but could it be that your function needs a return value? All my JavaScript functions return true or false, and it seems like I had a problem with a submit function similar to yours until I put in a return statement. Erik sachin wrote: hello all , i h

help : submit with javascript problem

2004-10-09 Thread sachin
hello all , i have a struts form and a button outside the form. on button click , with javascript i need the submit the form any help is welcome. My code is like following. but does not work function callSubmit() { document.forms[0].submit(); } Sachin Hegde -