Need alert message with "Yes" / "No" Selection

Hello.

I need a Alert prompt that prompts the user with a Message and a Yes/No choice.

Depending on what the user selects I need to act differently on each choice.

Is there a SC macro to handle this?

Any help is greatly appreciated.

hi instore,
did you try this?
http://www.scriptcase.net/docs/en_us/v8/scriptcase-macros/scriptcase-macros#sc_ajax_message
you can make a message and act based on the response via events

Hi MikeDE.

Thanks for this but how can I react to the response via events?

looking to do a couple of “If” statements based on the response.

Thanks for your help!

I usually use any code in the manual says something like:

if ({this})
{
echo “something”;
}
else
{
sc_error_message({error}); //this is example
}

Include more information so we can help.

I usually use any code in the manual says something like:

if ({this})
{
echo “something”;
}
else
{
sc_error_message({error}); //this is example
}

or have a look at this
http://www.scriptcase.net/docs/en_us/v8/scriptcase-macros/scriptcase-macros#sc_error_exit
search more in the manual, you will find many examples may suite your need

Ok. I’m still confused.

Here’s the scenario I’m trying to do…

I have a field call “PO”. onBlur of the field I need ajax to respond with a message “Leaving this field blank will clear multiple POs.<br>Do you want to proceed ?”.

If the user selects “Proceed” I need to clear 4 other fields and if the user selects no I just need to return the user to the field “PO” that they just left.

my error message code looks like this but I don’t know how to act on the return of the error message if I can?

if ({customer_po} == “”) {
// Javascript message parameters
$javascript_title = ‘WARNING’; // Javascript message title
$javascript_message = ‘Leaving this field blank will clear multiple POs.<br>Do you want to proceed ?’; // Javascript message contents
$javascript_parms = ‘modal=N&button=Y&button_label=Proceed&show_close=Y’;
$javascript_timeout = ‘timeout=0’;

// Display javascript message
sc_ajax_message($javascript_message, $javascript_title, $javascript_parms, $javascript_timeout);
}

did you try ifelse or else after your code?

instore,

Using sc_ajax_message, you can use “&redir=some_blank_form.php” in your parameter string, which would redirect you to another app, but unfortunately I think you cannot generate an event that you can intercept in your current application (which would be the ideal case).

Dave

Thanks Dave.

Seems really odd that such simple ability isn’t possible in SC.

They should really add that in!

2 Likes