I discovered yesterday that I had mistakenly used the closing syntax for the form. 
I'll illustrate this through an example.

I used this the following 

<html:form action="/logon.do" focus="userName"/>
......
</html:form>

instead of this

<html:form action="/logon.do" focus="userName">
......
</html:form>

Notice the second to the last character at the end '/>'

this generated the following in IE 5.x and it 'baffed' with an error.

<form name="aFormName" method="POST" action="/logon.do<sessionId>">
</form>
        <script language="javascript" >
        <!--
                document.forms["aformName"].elements["userName"].focus()
        // -->
        </script>.....

There was not content within the <form></form> syntax.

Thanks,

Paul Idusogie 
Technical Architect 
Consulting Services
Stellent Inc.
7777 Golden Triangle Drive
Eden Prairie, MN 55104
Desk: 952.656.2755
Fax: 952.903.2115
Email: [EMAIL PROTECTED]
website: http://www.stellent.com


-----Original Message-----
From: Xianzhong chen [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 5:24 PM
To: Paul Idusogie
Subject: RE: javascript appearing before object is created.


Hi,

Looks like the userName input doesn't have the name quoted. You didn't use
<html:text> from struts, do you? If you are manually making the <input ...>,
try changing 

        <input type=text size=16 name=userName value="">

to

        <input type=text size=16 name="userName" value="">

Good luck


-----Original Message-----
From: Paul Idusogie [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 2:52 PM
To: [EMAIL PROTECTED]
Subject: javascript appearing before object is created.
Importance: High


Could any provide a workaround?



I used the html:form tag syntax in a logon.jsp page with the following
syntax
<html:form action="/logon.do" focus="userName">
        .....
</html:form>

This will add the javascript portion to set the form username attribute on
focus when the page is launched. However I receive the following error:
'document.form.userName is null or not an object'

with IE 5.X. 

The javascript script appears before the rest of the form attributes when I
view the generated code using view source. It looks like this:

<form name="aFormName" method=POST action="/anAction.do">
        <script language="javascript" >
        <!--
                document.forms["aformName"].elements["userName"].focus()
        // -->
        </script>
        <table>
                <tr>
                        <td>UserName:</td>
                        <td><input type=text size=16 name=userName
value=""></td>
                </tr>
                        ....
        </table>
</form>

This error occurs probably because IE executes the javascript portion before
the page is painted. Any remedies, Please.

Thanks,

Paul Idusogie 
Technical Architect 
Consulting Services
Stellent Inc.
7777 Golden Triangle Drive
Eden Prairie, MN 55104
Desk: 952.656.2755
Fax: 952.903.2115
Email: [EMAIL PROTECTED]
website: http://www.stellent.com

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

Reply via email to