473,473 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

confirmation box when an event occurred in form

8 New Member
I want confirmation box when i press link "Are you sure want to navigate.. The Entered data will not be saved"... and the condition is ... when form content is not changed i dont want confirm box.(simply.. i want to check the event occurred in form... if it occurs confirm box...else...navigate...)I am having lot of textbox, checkbox, dropdown in my form.. so i unable to do this.. please help..as soon as possible....

Thanks in advance...

Expand|Select|Wrap|Line Numbers
  1. function modal(name,id)
  2.     {
  3.         var con =  confirm("The data will not be saved..Are you sure want to proceed!");
  4.  
  5.         if(con)
  6.         {    
  7.             var ttt = next(name,id);
  8.             return true;
  9.         }
  10.         else
  11.         {
  12.             return false;
  13.         }
  14.         return false;
  15.  
  16.     }
  17.     function next(name,id)
  18.     {
  19.         location.href= name +".php?id=" + id;
  20.         return true;
  21.     }

i dont want this confirm box when no changes made in form
Mar 18 '10 #1
2 1800
RamananKalirajan
608 Contributor
Have a global variable/global flag in default set the value as 0 or 1. Have a listener for all the form data in that page. If any value is changed set the flag to true or 1. When the user clicks on a link. Just check the flag before triggering the confirmation. If the value is true or 1 show the confirmation box or dont show it.

Thanks and Regards
Ramanan Kalirajan
Mar 18 '10 #2
sarvanhsr
8 New Member
thanks u a lot... i have done that.. its working...

i used onchange on every elements in my form...

is there any way to check onchange of whole form using function..

Again Thank u for kind reply
Mar 20 '10 #3

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

Similar topics

1
by: swingingming | last post by:
Hello, I don't know what I did in settings. Now any changes I made will go saved. And sometimes I am just testing things out. Where can I enable the confirmation? Thanks, ming
6
by: Dotnet Guy | last post by:
I want to add a confirmation dialog box before I delete the records in my form. I have a piece of javascript code in html that checks for confirmation. But the main issue lies in calling this...
6
by: Nedu N | last post by:
Hi, I want to have confirmation(Yes/No) on a button of the webform in which there are many validation controls. I want all the validation controls to be triggered first and then Yes/No...
6
by: Dave | last post by:
Hello. I want to prompt user for some action with Yes/No message, I know some tricks in JavaScript, but I need to handle the user answer at server side. Exactly I want to prompt user for...
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
5
by: Samy | last post by:
Hi There, I have a label in a datagrid which I make it a input type = radio in ItemDataBound so that radio buttons are shown in the datagrid. This is how I have it... ASPX... <asp:Label...
2
by: steggun | last post by:
How To: Popup Confirmation Dialog & Redirect in LinkButton_OnClick Hello All, I have a ASP.NET 2.0 (C#) web form with a LinkButton control. In the server-side code for the LinkButton_OnClick...
2
by: bienwell | last post by:
Hi all, I still have a problem when using Confirmation box in ASP.NET program. I need to get the value return of YES or NO from confirmation box in Sub function of VB program to do some tasks....
2
by: bay_dar | last post by:
Hi, I have an internal ASP.NET application that I'm are using to send e-mails out based on a single milepost or milepost range entered. I'm trying to do two things when a user clicks on the...
4
by: John Straumann | last post by:
Hi all: I have an ASP.NET form that submits info to the server, but the customer wants a confirmation window to open when the user clicks "Submit", and then the user would have to click "OK" on...
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
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
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
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
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
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
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
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...

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.