473,386 Members | 1,943 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,386 software developers and data experts.

JavaScript before postback a page with asp:button

I have an aspx page and I need that when the user press a Submit button it
first executes a javascript function to validate some input information, if
the validation pass continue with the postback, if it isn't stay in the page.
SOme help?
Nov 17 '05 #1
1 1501
Put
<form id="Form1" onsubmit="return CheckData()" method="post"
runat="server">

CheckData() is your javascript function. Make any calculations you
want inside and return true if you want the postback to execute and
the server code, otherwise return false and page will not postback

"=?Utf-8?B?QW5kcmVzIFJvbWVybw==?=" <An**********@discussions.microsoft.com> wrote in message news:<B7**********************************@microso ft.com>...
I have an aspx page and I need that when the user press a Submit button it
first executes a javascript function to validate some input information, if
the validation pass continue with the postback, if it isn't stay in the page.
SOme help?

Nov 17 '05 #2

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

Similar topics

11
by: Frag | last post by:
Hi guys, I searched around without any clear answer. Tons of stuff, but nothing concrete. I am trying to call this Javascript function: function ButtonClicked() { alert("The button has...
0
by: Maziar Aflatoun | last post by:
Hi everyone, I have the following shopping cart (basket view). However, Delete button in my datagrid doesn't fire any events. Does anyone know why? (It's a user web control) <%@ Control...
2
by: Prisy | last post by:
Is it possible to have the text of the first-letter in an <asp:button> underlined? I was able to do the following to get the first letter underlined: <STYLE type="text/css">...
8
by: sumit | last post by:
Hi, I want to add one java script function on the click of page button of datagrid. But how to get UI control of page button so that i should be able to add attribute for onClick event. ...
4
by: Tim Wallace | last post by:
I have an ascx file in which I want to sometimes create an asp:button control based on a given value. Nothing I've tried has worked. How can I accomplish this task? Tim
3
by: simon | last post by:
Hi, I was wondering how you include an asp.net button inside an xsl transform file. I want to put a button next to each entry when i style my xml data. Thanks in advance, Simon
4
by: hb | last post by:
Hi, When I add an asp:button (ex: id=btnLog) on home.aspx, I need to create btnLog_Click() event in home.aspx.cs, and also link this event and the button in OnInit() method by adding:...
3
by: JV | last post by:
This is for anyone who has tackled the accessibility issue on their web site (and if you haven't, I bet you will in future). Apparently the asp:button control always renders as '<input...
1
by: Praveen Ladwani | last post by:
I have written a click event for asp:button and I want to call a javascript function named setMethod() which I have wrtten seperately. Please tell me how to do this.
4
by: Mark Olbert | last post by:
I have a website (ASPNET2) where the master page has a button in it and my login page, which is a detail page of the master page, also has a button (a login button). Everything works fine if I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.