Jump to:

23355 Posts in 17734 Topics by 2862 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: 5401 Views
  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Userforms :: validation bug Link to this post

    Note that this won't really be 'fixed' for 2.4 since its the plugins / modules which are conflicting. Event_Calendar just needs to be updated to use the same jquery file as userforms (since its in jsparty) and any custom script use the correct jquery wrapper.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Userforms :: validation bug Link to this post

    I got the same issue with SilverStripe 2.3.4 and Userforms 0.2 Branch. No Event Calendar module here...
    Doesn't seem to be a module clash.. will investigate further.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Userforms :: validation bug Link to this post

    Got this resolved.
    I'm including a copy of jQuery and Userforms includes jQuery from the jsparty directory, this results in two versions of jQuery being loaded, causing this issue.

    I was able to solve this by subclassing UserDefinedForm and adding the following init method:

    public function init(){
       parent::init();
       // clear userforms includes
       Requirements::clear(THIRDPARTY_DIR . '/jquery/jquery.js');
       Requirements::clear(THIRDPARTY_DIR . '/jquery/plugins/validate/jquery.validate.min.js');
       // add validate plugin again (important because of include order)
       Requirements::javascript(THIRDPARTY_DIR . '/jquery/plugins/validate/jquery.validate.min.js');
    }

    One could also just include the bundled jQuery instead of another copy.. but that way I'm sure I got the jQuery version I need in order for my scripts to work.

  • joelg
    Avatar
    Community Member
    129 Posts

    Re: Userforms :: validation bug Link to this post

    Hi

    I had a similar issue with the new Uploadify module from Uncle Cheese.

    My form validation was breaking because the uploadify_init.js document didn't have this line at the top:

    jQuery.noConflict();

    Joel

  • zim
    Avatar
    Community Member
    135 Posts

    Re: Userforms :: validation bug Link to this post

    Hey people. I see this is an old post. but i am getting same problem with userforms. I am doing a lot of stuff with jquery and am using noconflict. i put my jquery document.ready function in top level page.ss.

    and am getting the error as userforms fires its own jquery doc.ready function.

    i could not see the easy solution to this in this thread. can anyone advise?

    do i need to put userform jquery stuff in my page.ss doc.ready function?

    5401 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.