[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How do you cancel  (return from) a form where you have set a SPRY text field as 'required'

Posted on 2010-01-06
Medium Priority
Last Modified: 2013-12-12
I have set a few fields on a form as being required (via SPRY) but I also have a 'Cancel' button on the page - of course if I hit the button,  control doesn't pass back to the php as the javascript intervenes first and issues error messages to each empty on screen field - how do you get around this?
Question by:me_patrick
LVL 70

Accepted Solution

Jason C. Levine earned 2000 total points
ID: 26192413
Hi me_patrick,

Does the "Cancel" button cause a form submission?  If so, then Spry (or most any validation) will fire because it works onSubmit by default.

You would need to use a reset button to return the form to its default state or not use a button at all (use a link instead).

Author Closing Comment

ID: 31673479
Of Course! Yes - use a link - thanks Jason.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month18 days, 17 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question