473,511 Members | 16,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

client side script

I have a asp.net button in my webform. I want to run a custom client side
script (javascript) before submit the page and go to behindcode.
It doesn't have to pass by existing validator controls , i e,
CausesValidation="False";

Any help how to do that?

Thanks
Ricardo

Nov 18 '05 #1
4 1058
myButton.Attributes.Add("onClick", "javascript:someFunction();")

Even if you had validation on this button, you could still do this.

"Ricardo Silveira" <ca****@terra.com.br> wrote in message news:ef**************@tk2msftngp13.phx.gbl...
I have a asp.net button in my webform. I want to run a custom client side
script (javascript) before submit the page and go to behindcode.
It doesn't have to pass by existing validator controls , i e,
CausesValidation="False";

Any help how to do that?

Thanks


Ricardo


Nov 18 '05 #2
Thanks a lot!

It worked !

You know how this javascript function can eventually avoid submit the page?

Thanks agan!

Ricardo

"Raterus" <ra*****@spam.org> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
myButton.Attributes.Add("onClick", "javascript:someFunction();")

Even if you had validation on this button, you could still do this.

"Ricardo Silveira" <ca****@terra.com.br> wrote in message
news:ef**************@tk2msftngp13.phx.gbl...
I have a asp.net button in my webform. I want to run a custom client side
script (javascript) before submit the page and go to behindcode.
It doesn't have to pass by existing validator controls , i e,
CausesValidation="False";

Any help how to do that?

Thanks
Ricardo

Nov 18 '05 #3
Avoid page submittal???

myButton.Attributes.Add("onClick", "javascript:return someFunction();")

Make sure someFunction() returns false to keep the form submittal from firing.

Mythran
"Ricardo Silveira" <ca****@terra.com.br> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Thanks a lot!

It worked !

You know how this javascript function can eventually avoid submit the page?

Thanks agan!

Ricardo

"Raterus" <ra*****@spam.org> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
myButton.Attributes.Add("onClick", "javascript:someFunction();")

Even if you had validation on this button, you could still do this.

"Ricardo Silveira" <ca****@terra.com.br> wrote in message
news:ef**************@tk2msftngp13.phx.gbl...
I have a asp.net button in my webform. I want to run a custom client side
script (javascript) before submit the page and go to behindcode.
It doesn't have to pass by existing validator controls , i e,
CausesValidation="False";

Any help how to do that?

Thanks
Ricardo


Nov 18 '05 #4
Hi

Don't add the Javascript bit

mySubmitBtn.Attributes.Add("onclick","return myHandler()");

return true/false from myHandler, false will cancel the submit
or use a regular button

--
Best Regards
Vidar Petursson
==============================
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/
http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground: http://213.190.104.211/ ( IE 5.5+ only )

No matter where you go there you are
==============================
"Ricardo Silveira" <ca****@terra.com.br> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Thanks a lot!

It worked !

You know how this javascript function can eventually avoid submit the
page?

Thanks agan!

Ricardo

"Raterus" <ra*****@spam.org> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
myButton.Attributes.Add("onClick", "javascript:someFunction();")

Even if you had validation on this button, you could still do this.

"Ricardo Silveira" <ca****@terra.com.br> wrote in message
news:ef**************@tk2msftngp13.phx.gbl...
I have a asp.net button in my webform. I want to run a custom client side
script (javascript) before submit the page and go to behindcode.
It doesn't have to pass by existing validator controls , i e,
CausesValidation="False";

Any help how to do that?

Thanks
Ricardo


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4316
by: Kathryn | last post by:
Hiya I have a problem with using some client side and server side scripting together in an ASP. I'm using VBScript. What I'm trying to achieve is this - - Page loads up and some server side...
5
1963
by: tmb | last post by:
Is there a way to use ASP to 'push' a new image to the client every 15 seconds or so? I guess the entire page will have to be 're-sent' to the client but I'm not sure. I'm trying to 'rotate'...
8
3654
by: Mike Fellows | last post by:
Ok, im not sure if this is at all possible and if it is how i go about it is beyond me i have a piece of client side code that requires a piece of data from the server side (an ID number in this...
1
1604
by: Carl Jones via .NET 247 | last post by:
(Type your message here) I'm trying to run a client-side script from a web page. It's a VB script that gets information (computer name, software versions etc )about the computer and writes it to a...
9
4899
by: Harry Smith | last post by:
While reading the documentation on IsStartupScriptRegistered, there is a reference to "client startup script" as "Determines if the client startup script is registered with the Page object." What...
7
1599
by: Mike Rand | last post by:
I am having a really hard time trying to get some client side code hooked up in VS2005, ASP 2.0. The code is in an .inc file (vbscript). The first problem I am encountering is the ASP.NET page...
3
1742
by: jesper_lofgren | last post by:
Hello, I have a problem, i have a event in asp.net codebehind file that updating a datasource. If that update went well i want to refresh my treeview thats on another page. The script works...
1
3126
by: Chris | last post by:
Hi, I have jsut started to learn ASP development and have read many articles regarding which is the best to use regarding JavaScript or VBScript. All of the learning that I have done so far has...
5
13103
by: Ankur | last post by:
Hi Folks, I am new for this group. I want to clarify one thing what's a basic difference between Client Side Java Script and Server Side Java Script. how we can differentiate it. Why we called...
5
2145
by: Simon | last post by:
I heard that we could do that by using AJAX. Could anybody share how to do it? Thanks.
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7427
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
7512
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
5671
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
5069
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
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
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.