INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Prompt to Save

Prompt to Save

(OP)
I'm using the below script to prompt a user to save once the exit button is clicked.

<script type="text/javascript">
function SavePopup(sender, args) {
args.set_cancel(!window.confirm("Do You Need to Save This Data ?"));
}
</script>

What I need to do is check if the save button is enabled before firing off the script. Not sure how to do that. Save button is called b2 So if b2 is enabled run the script and if b2 is NOT enabled, ignore the script.


Any help would be appreciated

Thanks

RE: Prompt to Save

Not sure exactly what you mean,
How are you disabling the save button? If the button is disabled, how is it being clicked?

----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: Prompt to Save

(OP)
sorry, this is running off the cancel button. sorry about that. so if the user clicks the cancel button I need the script to check if the save button is enabled and if so prompt the user to save the work, if the save button is not enabled, ignore and exit the form.

RE: Prompt to Save

Again, what save button?

How is your safe button not enabled? What do you do to disable it?

Does this script run when the save button is clicked? Or how does it get activated?





----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: Prompt to Save

(OP)
the save button is disabled the script gets ran from the cancel button
<telerik:RadButton ID="b2" runat="server" ButtonType="LinkButton" Text="Exit Form" CssClass="leftAlign" OnClientClicking="SavePopup">
<Icon PrimaryIconCssClass="rbCancel" PrimaryIconLeft="7" PrimaryIconTop="7" />
</telerik:RadButton>

RE: Prompt to Save

@dvannoy, perhaps, if you were able to provide a sample of what the properties of the "button" look like in both states will help.

That said, I employ two type tactics for this:
(1) Use a hidden field and set a value 0 or 1 and check this field. So, whenever your button property is set to ON, set the value of the hidden field to 1 and if OFF, set the value to 0.

(2) Use JQuery to read the attribute value of the component/element and take action accordingly.

Hope this helps!!!!

--
SouthBeach
http://www.fp2php.com
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.

RE: Prompt to Save

The un-processed ASP code is of no use. JS does not see the ASP code only the actual HTML results from it.

As southbeach implies above, we need to know how the Save Button is set to be disabled. In other words what it is you want to check in the button to verify its disabled. It has to have some property that makes it disabled. What is it?

Basically you can target the button by ID if it has one or by name if it's part of a form. But so far you have told us nothing about this save button, and the un-processed ASP code is of no use.

If you post the source code after having loaded the page on a browser, we may be able to help more.

As it is, we can't even guess at what it is you need to do to verify your button is disabled.

----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close