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

Validation on javascript in button and post back if it returns true

I have textboxes and dropdownlist on my page. And i have image button when i click this image button i m validating textboxes on javascript and if it returns true, i need to do a post back to save the values. If it is returns false it should not post back.

Please do help me on this.
Sep 22 '10 #1
1 1667
You can use the OnClientClick property. Return false to cancel the submit.

<asp:Button
runat="server"
Text="Ok"
OnClientClick="javascript:return confirm('Do you want to submit?');" />
Sep 23 '10 #2

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

Similar topics

0
by: Margaret | last post by:
I've got my forms more or less working - the login form now has a regular button instead of an asp:button, so I can attach the Window.Open call for the next page in the client code. I moved the...
1
by: Manan | last post by:
hello all, I have a simple question. on my .aspx page I have bunch of textbox, and dropdowns. One of the dropdown2 has postback = true. When the user selects an item, the brower will post back...
1
by: John | last post by:
I have attached the java script code to Button web control as follows. myButton.Attributes.Add("OnClick", "OpenWindow()") I have written java script to open the window in the OpenWindow...
3
by: Brian Henry | last post by:
I have two list boxes on my form... lstCanSend and lstRecipients... well then there are two buttons add and remove between them (your basic select and pick listing) which uses java script to move...
1
by: thomson | last post by:
Hi All, I do have a button control, which has a post back and has to do some server side validations also. I need to attach some client side scripting also , where it can be called only on the...
6
by: guoqi zheng | last post by:
In a regular html form, when user press "enter" key, the form will be submitted. However, in ASP.NET web form, a form will only be submitted (post back) when a special button is clicked. Many...
2
by: David Tilman | last post by:
I'm new to ASP .NET and have run into a problem. I have a child page open in a web application that the user adds information to and then clicks the save button. The information is added to a...
3
by: Jeremy Chapman | last post by:
I've created a custom control which outputs html at runtime like <span id="controlid" value="myvalue"></span>. On my page I have javascript that changes the value of the value attribute. On post...
2
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation....
2
by: sunilthk | last post by:
Hi All, I have a question. If javascript is disabled how asp.net determines which control has caused the post back. As we know that when we clicks on the button the buttons name goes with posted...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.