473,405 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Two functions + Validation problem

Hi all,
I have one form which has to do two functions on sumbit.
The form looks lik this.
<form method="post" id="searchlist" name="searchlist" onsubmit="return (OnSubmitForm(result) && validate())">

And the javascript is:
Expand|Select|Wrap|Line Numbers
  1. function OnSubmitForm(result)
  2.                 {
  3.  
  4.                   if(result == 'Show_Results')
  5.                   {
  6.                   document.searchlist.action ="?action=show_results";
  7.                   }
  8.                   else if(result == 'Download_CSV')
  9.                   {
  10.  
  11.                     document.searchlist.action ="?action=download_csv";
  12.                   }
  13.                   else if(result == 'Email_Results')
  14.                   {
  15.                     document.searchlist.action ="?action=email_results";
  16.                   }
  17.  
  18.                   document.searchlist.submit();
  19.                 }
  20.                 }
  21.  
Now, i want to add another one function validate(). This looks like
function validate(){
.....
.....
}

As soon as i click the submit button it gets submitted and it does not pass through validate() function.
Any Suggestions.

Thanks
Haan
Sep 27 '10 #1

✓ answered by Dormilich

if OnSubmitForm() returns false, validate() will be skipped ((false && ?) is always false)

1 1017
Dormilich
8,658 Expert Mod 8TB
if OnSubmitForm() returns false, validate() will be skipped ((false && ?) is always false)
Sep 27 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Enigman O'Maly | last post by:
I'm still somewhat new to object style programming (as will become evident), using VBA in Excel 2000 to automate some previously manual functions. I've defined a class module so that I can...
2
by: diong | last post by:
please help! i have a form validation problem. here is the code if ((form1.Decline.value=='') && (form1.OfficeStatus == "YES") & (form1.FloorBldgDiscStat.value=='')) { alert('Enter value on...
0
by: Brian | last post by:
I am having alot of trouble getting a XML document validated with a schema. I got a sample document and schema off of w3schools.com, which passed an online xml validator:...
2
by: Frank Py | last post by:
I'm tring to use a validation function example from WROX that looks at form fields on a submit. I can't seem to launch it. I have 2 other functions up in the header that work fine. Any help...
4
by: bnp | last post by:
Hi All, I am quite new the JavaScript. Basically I am a C++ programmer, but now I am working on JavaScript since last 5 days. I have a problem regarding the form validation. I have created a...
3
by: Michael Skulsky | last post by:
Hi all, I've got the following validation problem. There are 2 schemas and a document: ----------------------------------------------------------------- bar.xsd ====== <?xml version="1.0"...
2
by: TIBM | last post by:
Hi. I've posted this question on another newsgroup, but I haven't received any answers.. I have a login page where users input userID and password and click a Login button. Before calling the ...
0
by: koen | last post by:
Hi! In asp.net (version 1.1) I run into a problem when trying to perform client validation. The error I get on the client-side is : "Error: expected ';'". This problem occurs when I place a...
5
by: Tina | last post by:
the Edit, Update, Cancel, and Delete buttons in my datagrid are causing validation elsewhere on the page. I want to specify that these buttons should not cause validation but they have no design...
5
by: Kuldeep | last post by:
Framework: Visual Studio 2005 Technology: ASP.NET 2.0 Language: C#.NET 2.0 Hi All, We have developed a Web Application on Visual Studio 2005 (ASP.NET 2.0) and deployed it on the Client's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.