File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes code not working properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "code not working properly" Watch "code not working properly" New topic
Author

code not working properly

gaurav chhabra
Ranch Hand

Joined: Jul 24, 2004
Posts: 109
sir
i m new to javascript ,,,i have some problem in the code below...

<!-- JAI SHRI RAM -->
<html>
<head><title>JAI SHRI RAM</title></head>
<SCRIPT LANGUAGE="JavaScript">
function ValidateForm(form)
{
if(IsEmpty(form.name))
{
alert('jai shri ram')
return false;
}
return false;
}
</SCRIPT>
<body>

<form name=form1 action = "http://localhost:8080/main_page1.jsp" onSubmit="return ValidateForm(this)">
<input type="text" name="name">
<input type="submit">

</body>
</html>

it is not working plz tell me the problem
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What do you expect it to do and in what way is it not working?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
IsEmpty... WHERE is the function at?

Eric
H Wilson
Ranch Hand

Joined: Feb 23, 2005
Posts: 33
Originally posted by gaurav chhabra:

if(IsEmpty(form.name))
{
alert('jai shri ram')
return false;
}
return false;


I notice that you are returning false whether IsEmpty() returns true or false. Is that really what you want to do? Perhaps that is the source of the problem. Otherwise it must be something in the IsEmpty() function. You would need to post that code here to get feedback.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: code not working properly