How to add event when user clicks Next

153 views
Skip to first unread message

hevelhouse

unread,
Oct 14, 2013, 12:01:16 PM10/14/13
to xmpie...@googlegroups.com
I'm adding custom HTML to the page to show and hide fields based on users input.  I want to make sure that all required fields are answered when the user clicks on the default XMPie Next button.  How can I add an event to this to make sure all required fields are answered?  Is this the correct way to go or is there a better way?

Thanks,

Shawn

Mark Cini

unread,
Oct 14, 2013, 7:33:43 PM10/14/13
to xmpie...@googlegroups.com
Hi Shawn,

There is nothing built into uCreate XM for form field validation. There are 100's of different methods you can use. I'd suggest reading up on Spry validation which is built into Dreamweaver. It is an easy way to add form field validation without having to invest too much time learning Javascript or Jquery.

If you do a Google Search for "dreamweaver spry validation" you will find plenty of tutorials.

Regards,
Mark


--
You received this message because you are subscribed to the Google Groups "XMPie Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmpie-users...@googlegroups.com.
To post to this group, send email to xmpie...@googlegroups.com.
Visit this group at http://groups.google.com/group/xmpie-users.
For more options, visit https://groups.google.com/groups/opt_out.

Guillaume Besnier

unread,
Oct 15, 2013, 1:18:07 AM10/15/13
to xmpie...@googlegroups.com
The title and contents of the post did not mention it, but I have the feeling the question was more related to uStore than to XM.
Right?



Expéditeur : Mark Cini <mark...@gmail.com>
Date de réception : Mardi, Octobre 15, 2013 1:33AM
Destinataire : xmpie...@googlegroups.com
Sujet : Re: [xmpie-users] How to add event when user clicks Next

 

hevelhouse

unread,
Nov 19, 2013, 3:42:33 PM11/19/13
to xmpie...@googlegroups.com
Bill.  yes.  I've added custom html and I want to add some validation to the page to make sure the user does indeed select an option.  Any idea on how to validate the users responses and throw an error and not allowing the user to leave the page until the error goes away?

Thoughts and help???

Igor

unread,
Nov 21, 2013, 9:27:30 AM11/21/13
to xmpie...@googlegroups.com
Once next button is clicked , uStore by default will validate all the fileds if validation was specified. HTML Generic has mandatory validation and it can be used.
you need to enable default uStore mandatory validation on your HTML generic and pass empty value if you want to stop user to go forward.

007design

unread,
Nov 21, 2013, 11:59:40 AM11/21/13
to xmpie...@googlegroups.com
you could try overriding the next button click event, something like this:

var nextButton = $('#ctl00_cphMainContentFooter_WizardStepsNextPrev1_ButtonNext');
var clickEvent = nextButton.attr('onclick');
nextButton.removeAttr('onclick').click(function(){
// Do custom validation here
if (isValid)
eval(clickEvent)
});

perhaps not the best solution but TIMTOWTDI

Igor

unread,
Nov 21, 2013, 6:20:42 PM11/21/13
to xmpie...@googlegroups.com
First you need to search the element  since it's name given by .net and it can be different so I'd search by partial name.
So this is something that should demonstrate what can be done. You need to test it.

var nextBtn = $($("[id$='WizardStepsNextPrev1_ButtonNext']")[0]);
var dialSummaryControl = $("#tdDialSummary").find('div').first();
if (nextBtn  != null) {
var uStoreOnClick = nextBtn.attr('onclick');
nextBtn.removeAttr('onclick').click(function(Obj) {
    var r= confirm (' Did I pass my custom validation?');
    if(r)
    {
       // pass my value to ustore
      //initiate ustore original call
        jQuery.globalEval(uStoreOnClick) ;
    }
    else {
      if(dialSummaryControl != null)
        {
       // show error div
        dialSummaryControl.show();
         //tell customer what should be fixed 
        dialSummaryControl.html('<ul><li>you need to fix it</li></ul>');
        }
        return false;
    }
  });
};

hevelhouse

unread,
Nov 22, 2013, 11:24:59 AM11/22/13
to xmpie...@googlegroups.com
I got this working by making the field mandatory and then remove the value if user doesn't check the checkbox.  If they check the box then the field is already marked mandatory and they will get an error if they fail to answer the question.

Thanks,


On Monday, October 14, 2013 12:01:16 PM UTC-4, hevelhouse wrote:
Reply all
Reply to author
Forward
0 new messages