Jump to:

22997 Posts in 11620 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » Userforms :: validation bug

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3
Go to End
Author Topic: 5210 Views
  • Junglefish
    Avatar
    Community Member
    104 Posts

    Userforms :: validation bug Link to this post

    Hi all

    Just set up a basic user form, nothing fancy. Set a couple of fields to be mandatory and I'm getting script errors on page load.

    Firebug says:

    $("#Form_Form").validate is not a function

    and points to this line of code in the source:

    , EditableDropdown19:{
    required:1
    }

    If I then make that field not mandatory and run the page again, Firebug says the same and points me at the source code for the previous formfield:

    , EditableTextField18:{
    maxlength:"1000"
    }

    and so on.

    Anyone seen this before or know what's happening?

    jf/

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Userforms :: validation bug Link to this post

    Sounds like a javascript namespace issue. Are you including jQuery or some other framework that would interfere with the default Prototype use of $?

  • Junglefish
    Avatar
    Community Member
    104 Posts

    Re: Userforms :: validation bug Link to this post

    @dalesaurus. No, I'm not specifically including anything special, I'm just using a standard SS installation, nothing fancy.

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Userforms :: validation bug Link to this post

    Hmmmm, can't troubleshoot without some more information. Can you post your form code and/or point to a live site to see the error?

  • Junglefish
    Avatar
    Community Member
    104 Posts

    Re: Userforms :: validation bug Link to this post

    @dalesaurus. Okay, I've saved out the source code of the page in question, and it's attached.

    I notice that the $("#Form_Form").validate() function appears to be included on the page twice. Is this normal?
    Also, there is a call to a JQuery script just above those functions, but that's SS just doing what it normally does, no?

    jf/

    Attached Files
  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Userforms :: validation bug Link to this post

    Sorry I wasn't clear, I meant the PHP source code. Are you writing your own forms or is this from the UserForms module? I see that your date fields are not the standard 2.3.3 validated with Prototype/Behaviour. Are you using a beta version of SS?

    SS Forms are pretty bang-bang out of the box, if you are having this much trouble something is wrong.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Userforms :: validation bug Link to this post

    SS Forms are pretty bang-bang out of the box.. Quote of the day! Nice one dalesaurus

  • Junglefish
    Avatar
    Community Member
    104 Posts

    Re: Userforms :: validation bug Link to this post

    @dalesaurus.

    I'm using a standard installation of SilverStripe CMS - 2.3.3 and the form is generated by the UserForms module.

    Which php files are you interested in looking at?

    jf/

    5210 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.