Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

Javascript : formname.body.value.length == 0 validation

Thread view: 
planetparag - 07 Feb 2006 17:29 GMT
Hi,
We have a J2EE application which had jsp's that represent a form. When
we submit the jsp's the form is converted into a mail and is sent using
a mail server.
In the jsp there is a validation where we check for the length of the
body using the following:
if (formname.body.value.length == 0)
{
    isFormComplete = false;
}

Need to know which are the possible cases when the length of the form
could be '0'.
The behaviour is real weird. Roughly 2 out of 10 times the length comes
as 0 even when the user enters all the details. What could be the
reason for the same ?
Any pointers are highly appreciated.

Regards,
Parag
Rhino - 07 Feb 2006 18:30 GMT
> Hi,
> We have a J2EE application which had jsp's that represent a form. When
[quoted text clipped - 13 lines]
> reason for the same ?
> Any pointers are highly appreciated.

The only pointer I have is that you are on the wrong newsgroup; you want
comp.lang.javascript. Despite the similarity in names, Java and JavaScript
have nothing to do with one another and aren't even owned by the same
companies. It's just an unfortunate coincidence that confuses people.

--
Rhino
Oliver Wong - 07 Feb 2006 20:02 GMT
>> Hi,
>> We have a J2EE application which had jsp's that represent a form. When
[quoted text clipped - 18 lines]
> have nothing to do with one another and aren't even owned by the same
> companies. It's just an unfortunate coincidence that confuses people.

   What's funny is that the OP doesn't ever actually mention JavaScript in
the body of the message. That if-statement could very well be JSP code, in
which case this might actually be the correct newsgroup after all, or it
could be JavaScript code, where it is inappropriate here.

   The OP should clarify whether the code (s)he quoted is located in the
generated HTML that the browser sees, or is hidden in the JSP code on the
server side.

   - Oliver
Rhino - 08 Feb 2006 05:01 GMT
>>> Hi,
>>> We have a J2EE application which had jsp's that represent a form. When
[quoted text clipped - 28 lines]
> generated HTML that the browser sees, or is hidden in the JSP code on the
> server side.

You are absolutely right.

I don't do JSPs, just servlets, so I assumed the subject line indicated a
pure JavaScript question. But if that syntax is valid in JSPs, then the
question might belong here after all.

The OP definitely needs to clarify the question if he/she intends it to be
answered here.

--
Rhino


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.