Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Placing all errors at beginning of a page
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Byron Raines  
View profile  
 More options Jan 23, 6:44 pm
From: Byron Raines <byron.rai...@gmail.com>
Date: Mon, 23 Jan 2012 15:44:23 -0800 (PST)
Local: Mon, Jan 23 2012 6:44 pm
Subject: Placing all errors at beginning of a page
Hi all.  Getting back into ValidateThis.  I have a form that is using
jQuery tabs.  Since it is a tabbed form, I'd like to show all the
errors at the top of the page.  When someone hits save, and the form
validates, depending on what tab is showing, you may not see errors on
other tabs.    I see where I can change the defaults:

        jQuery.validator.setDefaults({
                errorClass: 'errorField',
                errorElement: 'p',
                errorPlacement: function(error, element) {
                error.prependTo( element.parents('div.ctrlHolder') )
                },

but not sure how to edit the errorPlacement attribute.  Any
suggestions on how to accomplish this?

Thanks

Byron


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bob Silverberg  
View profile  
 More options Jan 23, 11:01 pm
From: Bob Silverberg <bob.silverb...@gmail.com>
Date: Mon, 23 Jan 2012 23:01:14 -0500
Local: Mon, Jan 23 2012 11:01 pm
Subject: Re: [ValidateThis] Placing all errors at beginning of a page
Hi Byron,

I've never done much monkeying around with the jQuery plugin. John is
our resident expert. John, do you have any suggestions for Byron?

Cheers,
Bob

--
Bob Silverberg
www.silverwareconsulting.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Quackenbush  
View profile  
 More options Jan 23, 11:20 pm
From: Matt Quackenbush <quackfu...@gmail.com>
Date: Mon, 23 Jan 2012 22:20:13 -0600
Local: Mon, Jan 23 2012 11:20 pm
Subject: Re: [ValidateThis] Placing all errors at beginning of a page

Hey Byron,

This is something that has been on my "back burner" list for quite awhile
now. I've not had any time to dig into it, but I think it will require a
little bit of trickery - for lack of a better term. In a nutshell, there
needs to be an error container of some sort, which is not present with
cfUniForm unless server-side errors are returned AND placement is set to
'top' or 'both'. So, it will need to check for the existence of the
container and insert the message if present; otherwise, create the
container and insert the message.

So, the function in the `errorPlacement` setting would do that
check/insert, rather than simply prepending the error to the parent
`ctrlHolder` div.  Assuming markup similar to this....

<div id="errorMsg">
    <h3>Yo Chit Be Hozed!</h3>
    <p>Fix it now, homey!</p>
    <ul id="errorMsgList">
    </ul>
</div>

... you'd append an <li> with the message to #errorMsgList.

It's late and my brain cells are fried, but hopefully that will give you or
John (or someone) a push in the right direction.

Whenever you/I/we/someone gets this figured out, this will go into
cfUniForm, hopefully auto-detecting the presence of tabs and smartly
switching the errorPlacement.

On Mon, Jan 23, 2012 at 10:01 PM, Bob Silverberg
<bob.silverb...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Byron Raines  
View profile  
 More options Jan 24, 12:43 pm
From: Byron Raines <byron.rai...@gmail.com>
Date: Tue, 24 Jan 2012 09:43:50 -0800 (PST)
Local: Tues, Jan 24 2012 12:43 pm
Subject: Re: Placing all errors at beginning of a page
Thanks, Matt.  I think that's a good place to start.  I'll see what I
can come up with.

Byron

On Jan 23, 11:20 pm, Matt Quackenbush <quackfu...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Whish  
View profile  
 More options Jan 28, 12:01 pm
From: John Whish <john.wh...@googlemail.com>
Date: Sat, 28 Jan 2012 17:01:33 +0000
Local: Sat, Jan 28 2012 12:01 pm
Subject: Re: [ValidateThis] Re: Placing all errors at beginning of a page
Hi,
Sorry for the late input on this thread. I have done this in the past
before ValidateThis was born using the validate plugin. If I remember
correctly, then I just made all hidden form fields (the ones in the
hidden tabs) so that they were ignored by the validator.

$("#myform").validate({
   ignore: ".ignore"

})

I did also have to make sure that if the tab was valid, then the
ignore class was removed from all fields and validation called again
so that the form would only submit if all fields passed.

I'll have to see if I can find the code as I'm saying this from what I
recall I did which may be a complete lie :)

On 24 January 2012 17:43, Byron Raines <byron.rai...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martijn van der Woud  
View profile  
 More options Feb 1, 9:54 am
From: Martijn van der Woud <martijnvanderw...@gmail.com>
Date: Wed, 1 Feb 2012 06:54:53 -0800 (PST)
Local: Wed, Feb 1 2012 9:54 am
Subject: Re: Placing all errors at beginning of a page
Another option is to call the validate() method and provide an
errorplacement() function, which is called every time a field becomes
marked as invalid. You have full control over error placement from
there. Not sure about the exact name of the function, you can look it
up in the docs of the jquery validation plugin.

On 28 jan, 18:01, John Whish <john.wh...@googlemail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »