About this topic

  • Posted by davedr 2 years ago. There are 2 posts. The latest reply is from byron.
  • This topic is not resolved
  1. User sommernyte posted some great info on validating form submissions in this thread:

    http://smashly.net/community/topic/using-js-to-add-form-validationrequired-fields#post-790

    I'm following her ideas too. I'm able to get a JS function to "fire" when a user clicks "submit" but the image still goes along and submits a blank post anyway. It doesn't wait for my JS validator. The validator pops up its messages, but the form goes through.

    I guess what I'm asking is: what is it within PhotoSmash (and/or Extend) that controls the form submission? How might I intercept that? I tried applying a random PHP page to the action of the form, but it didn't have any effect.

  2. Hi Dave,

    I'm not sure...will need to study it some, but the onsubmit has to return false, or the form will submit like a normal form.

    The action of the form is not being used...the onsubmit is going to a jQuery Ajax function.

    I'll need to see what sommernyte said, but basically, you'll need a separate form submit button that does your validation and then submits if it passes, else it returns false.

    Let me know if that isn't enough to get you started. It's the best I can do off the top of my head.

    BB

RSS feed for this topic