/    Sign up×
Community /Pin to ProfileBookmark

How to prompt user to save changes after submit?

Not too sure if we post to the right forum as our code this time involve PHP as well.
?

Could anyone help???

What we are going to do is we have a text box, once the user change the stuf in the text box, after the submit button is clicked, a prompt will appear to ask if the user want to save changes or not.

We already did the coding which when the user type something in or delete something from the text box making the text box value different from it’s default value, a warning message will appear on the title. Then when the user click submit, the whole page will refresh with the edited message in the text box. We did the refresh stuf using PHP.

Now we want to add a prompt to ask if the user want to save changes when the text box is edited. We don’t know how can we pass the valuables from the PHP to the javascript. Or is there another way to do it???

Hope the description doesn’t confused you !!!

:p Bo&Vic

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@mini_dumboauthorNov 24.2002 — ? Thanks, that's what we want to know. But what about if we want the prompt box appears as a prompt sentence say "Do you want to save changes?" with 3 buttons of 'yes', 'no', 'cancel'. Is that possible? Cos it sort of different from the normal prompt we can use from javascript.

Cheers,

Bo&Vic :rolleyes:
Copy linkTweet thisAlerts:
@mini_dumboauthorNov 25.2002 — By the way, we did try using the confirm function, but it only give us a 'ok' and 'cancel' button. We hope we can work somthing like if we click 'yes' it will save, 'no' will not save anything, and 'cancel' will remain to the current page.

Could anyone help PLEASE !!! :eek:

Bo&Vic :p
Copy linkTweet thisAlerts:
@mini_dumboauthorNov 25.2002 — Ah, thanks, so we can't actually have a box looks like the confirm one, but have to design our own window popup.

We might have a try first then get back to u later.

? Bo&Vic
Copy linkTweet thisAlerts:
@mini_dumboauthorNov 25.2002 — Thanks to your suggestion we've now created a pop up window with three buttons,:rolleyes: but now we're having trouble knowing how to link this back to have an effect on the previous page when user clicks a choice. (eg if user click "yes" for "do u want to save your changes?", we don't know how to go back to the previous page where the user has changed the input box)... we're wondering if it's possible to call(or go back and run) just a particular function in an html page from the pop up window itself(eg running a javascript function or php code etc....)... ?

Thanks....

Bo & Vic?
Copy linkTweet thisAlerts:
@mini_dumboauthorNov 26.2002 — :eek: somebody please help us... !!!


Is it possible to use javascript (as in without relying on php) to achieve the following effect:

Say you have an input box, and the user types something in it and is prompted with a pop-up window with buttons "yes", "no" and "cancel", asking if he/she wants to save the changes... if user clicks yes, pop-up window will close and user will be returned to parent window with text in input box unchanged(i.e. origial text from inbox PLUS extra stuff typed in by user) , but if user clicks no, pop-up window will also close but instead of the previous case, only the original text(whatever was in it before user types anything) will remain in the box. We managed to do the "yes" case with some php codes but we're too much of a newbie in everything that we were so stuck from that point... so we're just wondering if it's possible to do the above problem entirely in javascript....

Any help would be appreciated!! ?



:p & ?
×

Success!

Help @mini_dumbo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...