No announcement yet.

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

  • Filter
  • Time
  • Show
Clear All
new posts

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


    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.

  • #2
    hi instore,
    did you try this?
    you can make a message and act based on the response via events


    • #3
      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!


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

        if ({this})
        echo "something";
        sc_error_message({error}); //this is example

        or have a look at this
        search more in the manual, you will find many examples may suite your need


        • #5
          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);


          • #6
            did you try ifelse or else after your code?


            • #7

              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 Prue
              Code Whisperer
              Lahar International Corp


              • #8
                Thanks Dave.

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

                They should really add that in!