473,503 Members | 3,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to call two javascript functions onclick of a submit button?

4 New Member
Hello every one,

I am using VS 2005, I am having selection of From & To dates in every page of project, for validation of these two fields I written common javascript function in master page, I am calling this function on attributes property of button.
Now I want to validate other controls of the pages too, which has to be written in that page itself. So how can I achieve this?
Feb 26 '08 #1
4 23693
r035198x
13,262 MVP
Hello every one,

I am using VS 2005, I am having selection of From & To dates in every page of project, for validation of these two fields I written common javascript function in master page, I am calling this function on attributes property of button.
Now I want to validate other controls of the pages too, which has to be written in that page itself. So how can I achieve this?
Either you create one Javascript function, say called validateForm, and you call all those functions from that function or you call each of the functions separating them by a semi-colon.
Feb 26 '08 #2
shweta123
692 Recognized Expert Contributor
Hi,

You can call the 2 javascript functions on onClick event of submit button like this way :
btnSubmit.Attributes.add("onClick","function1();fu nction2();")

Hello every one,

I am using VS 2005, I am having selection of From & To dates in every page of project, for validation of these two fields I written common javascript function in master page, I am calling this function on attributes property of button.
Now I want to validate other controls of the pages too, which has to be written in that page itself. So how can I achieve this?
Feb 26 '08 #3
ameetijantakar
4 New Member
Hi,

You can call the 2 javascript functions on onClick event of submit button like this way :
btnSubmit.Attributes.add("onClick","function1();fu nction2();")

Hi Shweta,

This is Ameet, I tried this
btnSubmit.Attributes.Add("onclick", "return validatesas();return check();");

but only 1st function validatesas() is executing, if I replace function check() on 1st position, then only check() is executing.
Feb 27 '08 #4
wwwLdietCoUk
1 New Member
this is what worked for me:
<input type="button" value="Calculate" onClick="(func1(), func2() )" >

mark.
Dec 3 '09 #5

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

Similar topics

3
4016
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
14
5420
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
4
4271
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
5
2574
by: settyv | last post by:
Hi, Below is the Javascript function that am trying to call from asp:Button control. <script language="javascript"> function ValidateDate(fromDate,toDate) { var fromDate=new Date();
1
6445
by: saiyen | last post by:
Hey all, ive been banging my head agains the wall for a few days now, and finally decided to ask for help. i have a document that writes the header with all the javascript in it, then modifyes a...
9
2217
by: IchBin | last post by:
I can not see what the problem is with this script. I am just trying to set a radio button by calling setCheckedValue('abbr_letter', 'V'). Sorry I am new to javascript. <html> <head> <script...
10
6047
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
10
7278
by: evicailieva | last post by:
A have a php scrip where I call a JavaScript function. I don't know why, but it doesn't work. At the beginning, when I was writing the script it was working but now it's not. I don't know wхat to do....
5
5775
by: plumba | last post by:
Ok, another query.... I have a checkbox at the bottom of my form which when checked unhides a <div> block which displays the submit button. The problem I have is when the clear form button is...
0
7064
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
7315
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
7445
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
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4991
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...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.