You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nadia Kunkov <na...@parkerglobal.com> on 2005/01/25 17:20:36 UTC

struts and java script and jsp

Hi,

I'm not sure if this question is really about struts even though it occures in my struts application.  My apologies if this is a bit off topic.
I have a jsp logon page with two input fields "userId' and "password"
I of course have a corresponding ActionForm with the same attributes.
When I open my Logon page in Mozilla I have no problem whatosever.
When I open it in IE it's done with errors on page and  I have the following message:
document.forms["logonForm"].elements["username"].type is null or not an object

When I looked at the page source I saw the following javascript added:
<script language="javascript">
<!--
if (document.forms["logonForm"].elements["username"].type  != "hidden"
document.forms["logonForm"].elements["username"].focus()
//-->
</script>

I'm wondering why this javascript is being added and does it have anything to do with struts?
Also, could the problem be that it refers to element["username"] that does not exist in my jsp, since I have "userId"?
Then, where does it come up with "username"?
How do I get around it?
Should I change my form to have "username"?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts and java script and jsp

Posted by Kumar deepak <de...@yahoo.com>.
Hi,

Please have a look at:
http://roseindia.net/struts/address_struts_validator.shtml

Tutorial shows you how to validate using sturts
generated java scripts. 

Regards
Deepak Kumar

--- Hanson Char <ha...@gmail.com> wrote:

> > Then, where does it come up with "username"?
> 
> Could it be that you have "username" specified in
> validator.xml ?
> 
> H
> 
> On Tue, 1 Feb 2005 11:22:48 +0100, Cedric Levieux
> <jo...@gmail.com> wrote:
> > Hi,
> > 
> > You have this JavaScript code cause you ask into
> the <htm:form> tag the
> > ability to focus on a form field.
> > 
> > But btw I don't understand why the javascript code
> didn't work :p
> > 
> > Regards,
> > 
> > Cedric
> > ----- Original Message -----
> > From: "Nadia Kunkov" <na...@parkerglobal.com>
> > To: "Struts help (E-mail)"
> <us...@struts.apache.org>
> > Sent: Tuesday, January 25, 2005 5:20 PM
> > Subject: struts and java script and jsp
> > 
> > Hi,
> > 
> > I'm not sure if this question is really about
> struts even though it occures
> > in my struts application.  My apologies if this is
> a bit off topic.
> > I have a jsp logon page with two input fields
> "userId' and "password"
> > I of course have a corresponding ActionForm with
> the same attributes.
> > When I open my Logon page in Mozilla I have no
> problem whatosever.
> > When I open it in IE it's done with errors on page
> and  I have the following
> > message:
> >
>
document.forms["logonForm"].elements["username"].type
> is null or not an
> > object
> > 
> > When I looked at the page source I saw the
> following javascript added:
> > <script language="javascript">
> > <!--
> > if
>
(document.forms["logonForm"].elements["username"].type
>  != "hidden"
> >
>
document.forms["logonForm"].elements["username"].focus()
> > //-->
> > </script>
> > 
> > I'm wondering why this javascript is being added
> and does it have anything
> > to do with struts?
> > Also, could the problem be that it refers to
> element["username"] that does
> > not exist in my jsp, since I have "userId"?
> > Then, where does it come up with "username"?
> > How do I get around it?
> > Should I change my form to have "username"?
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts and java script and jsp

Posted by Hanson Char <ha...@gmail.com>.
> Then, where does it come up with "username"?

Could it be that you have "username" specified in validator.xml ?

H

On Tue, 1 Feb 2005 11:22:48 +0100, Cedric Levieux <jo...@gmail.com> wrote:
> Hi,
> 
> You have this JavaScript code cause you ask into the <htm:form> tag the
> ability to focus on a form field.
> 
> But btw I don't understand why the javascript code didn't work :p
> 
> Regards,
> 
> Cedric
> ----- Original Message -----
> From: "Nadia Kunkov" <na...@parkerglobal.com>
> To: "Struts help (E-mail)" <us...@struts.apache.org>
> Sent: Tuesday, January 25, 2005 5:20 PM
> Subject: struts and java script and jsp
> 
> Hi,
> 
> I'm not sure if this question is really about struts even though it occures
> in my struts application.  My apologies if this is a bit off topic.
> I have a jsp logon page with two input fields "userId' and "password"
> I of course have a corresponding ActionForm with the same attributes.
> When I open my Logon page in Mozilla I have no problem whatosever.
> When I open it in IE it's done with errors on page and  I have the following
> message:
> document.forms["logonForm"].elements["username"].type is null or not an
> object
> 
> When I looked at the page source I saw the following javascript added:
> <script language="javascript">
> <!--
> if (document.forms["logonForm"].elements["username"].type  != "hidden"
> document.forms["logonForm"].elements["username"].focus()
> //-->
> </script>
> 
> I'm wondering why this javascript is being added and does it have anything
> to do with struts?
> Also, could the problem be that it refers to element["username"] that does
> not exist in my jsp, since I have "userId"?
> Then, where does it come up with "username"?
> How do I get around it?
> Should I change my form to have "username"?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts and java script and jsp

Posted by Cedric Levieux <jo...@gmail.com>.
Hi,

You have this JavaScript code cause you ask into the <htm:form> tag the
ability to focus on a form field.

But btw I don't understand why the javascript code didn't work :p

Regards,

Cedric
----- Original Message ----- 
From: "Nadia Kunkov" <na...@parkerglobal.com>
To: "Struts help (E-mail)" <us...@struts.apache.org>
Sent: Tuesday, January 25, 2005 5:20 PM
Subject: struts and java script and jsp


Hi,

I'm not sure if this question is really about struts even though it occures
in my struts application.  My apologies if this is a bit off topic.
I have a jsp logon page with two input fields "userId' and "password"
I of course have a corresponding ActionForm with the same attributes.
When I open my Logon page in Mozilla I have no problem whatosever.
When I open it in IE it's done with errors on page and  I have the following
message:
document.forms["logonForm"].elements["username"].type is null or not an
object

When I looked at the page source I saw the following javascript added:
<script language="javascript">
<!--
if (document.forms["logonForm"].elements["username"].type  != "hidden"
document.forms["logonForm"].elements["username"].focus()
//-->
</script>

I'm wondering why this javascript is being added and does it have anything
to do with struts?
Also, could the problem be that it refers to element["username"] that does
not exist in my jsp, since I have "userId"?
Then, where does it come up with "username"?
How do I get around it?
Should I change my form to have "username"?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts and java script and jsp

Posted by Will Stranathan <wi...@thestranathans.com>.
That code is being put in because you set the focus attribute of the 
html:form tag, but there is no attribute called username.

w
On Tue, 25 Jan 2005 11:20:36 -0500
  "Nadia Kunkov" <na...@parkerglobal.com> wrote:
>Hi,
>
>I'm not sure if this question is really about struts even though it 
>occures in my struts application.  My apologies if this is a bit off 
>topic.
>I have a jsp logon page with two input fields "userId' and "password"
>I of course have a corresponding ActionForm with the same attributes.
>When I open my Logon page in Mozilla I have no problem whatosever.
>When I open it in IE it's done with errors on page and  I have the 
>following message:
>document.forms["logonForm"].elements["username"].type is null or not 
>an object
>
>When I looked at the page source I saw the following javascript 
>added:
><script language="javascript">
><!--
>if (document.forms["logonForm"].elements["username"].type  != 
>"hidden"
>document.forms["logonForm"].elements["username"].focus()
>//-->
></script>
>
>I'm wondering why this javascript is being added and does it have 
>anything to do with struts?
>Also, could the problem be that it refers to element["username"] that 
>does not exist in my jsp, since I have "userId"?
>Then, where does it come up with "username"?
>How do I get around it?
>Should I change my form to have "username"?
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org