Re: [jQuery] Re: Autocomplete plugin compatability with jQuery 1.4?

2010-02-01 Thread Jörn Zaefferer
I've replied on that here:
http://forum.jquery.com/topic/1-8rc1-autocomplete-search-options

So far I don't plan to update the standalone plugin, though if you can
provide a patch for 1.4 compability, I'd push out another release.

Jörn

On Mon, Feb 1, 2010 at 3:32 PM, Anthony antray...@gmail.com wrote:
 Hi,

 Thanks for your responses. Can I ask 1 follow up question...

 Bearing in mind this has now been integrated into jQuery UI 1.8rc1, is
 it safe to assume that there any no plans to make the old version 1.1
 of the 'Autocomplete' plugin compatible with jQuery 1.4?  The reason I
 ask is that it looks like there are a fair number of missing options
 from the new integrated version (the most important for us our the
 'multiple' related options and the searching options (eg 'matchCase'
 and 'matchContains')). Or is the intention to add these or similar to
 the new integrated jQuery UI version?

 Just be interested to know, as we are already making good use of some
 of the above options in our product, want to upgrade to jQuery 1.4 and
 jQuery 1.8 as soon as we can, but have hit this hurdle.

 Regards,
 Anthony.




 On Jan 31, 9:31 pm, Richard D. Worth rdwo...@gmail.com wrote:
 Yes, and yes.

 On Sun, Jan 31, 2010 at 3:41 PM, Jose jmal...@gmail.com wrote:
  On Fri, Jan 29, 2010 at 1:38 AM, Richard D. Worth rdwo...@gmail.com
  wrote:
   The latest version is jQuery UI Autocomplete, and it is compatible with
   jQuery 1.4. You can find it in jQuery UI 1.8rc1:

  http://blog.jqueryui.com/2010/01/jquery-ui-1-8rc1/

  Is the UI autocomplete based on Jörn's autocomplete ? If seems a huge
  refactoring!

  regards



Re: [jQuery] Validator plugin class=cancel not working when submit called from script

2010-01-19 Thread Jörn Zaefferer
Try .click() instead of .submit().

Jörn

On Tue, Jan 19, 2010 at 3:04 AM, Flying Duck moore.p...@gmail.com wrote:

 When the user clicks on an input button where cancel is added to the
 class attribute, the form submits as expected, but when the the input
 button is submitted by script like this, $(input
 [name='Btn_Cancel']).submit(), then the validation fires as if the
 class=cancel is not there.

 Any idea why the difference in the ways of submitting the form?

 I'm using jquery 1.3.2 and jquery.validate 1.6.

 Thanks



Re: [jQuery] (validation): remote rule causes submit to abort, fix included

2009-12-21 Thread Jörn Zaefferer
The plugin will submit the form after the async request finishes. The
remaining problem is that any submit-button won't be submitted. Maybe thats
the problem you had?

Jörn

On Mon, Dec 21, 2009 at 8:15 AM, KenGreer k...@dancesoft.com wrote:

 With the validation plugin (http://bassistance.de/jquery-plugins/
 jquery-plugin-validation/http://bassistance.de/jquery-plugins/%0Ajquery-plugin-validation/)
 I included two remote rules to check
 username and e-mail. If my form is loaded such that the username and e-
 mail are already filled in, and, therefore, have not yet been
 validated, and I click SUBMIT, validation proceeds just fine, but the
 form does NOT submit! A second click of the submit button, however,
 then works.

 I speculated that this was because of pending ajax calls aborting the
 submit. It seems my speculation held true. Right after my $
 (document).ready(function() { ... I added the code:

$.ajaxSetup( {
async: false
} );

 to make the remote ajax calls synchronous and this fixed the
 problem. Now clicking submit performs the validation and really does
 submit.

 Hopefully a more elegant solution will be found in the validation
 plugin itself, but as a jquery newbie, I found reading the validation
 plugin code daunting!



Re: [jQuery] Re: validate - error messages keep piling up

2009-12-16 Thread Jörn Zaefferer
Could you provide a full example, eg. via jsbin.com?

Jörn

On Wed, Dec 16, 2009 at 2:53 PM, Mark Livingstone namematters...@msn.comwrote:

 anyone? :)

 On Dec 15, 12:37 pm, Mark Livingstone namematters...@msn.com wrote:
  Hi,
 
  Since I moved to a new design I cannot figure out how to stop the
  validate plug-in to append error messages and instead have it remove
  the previous error message before creating another one.
 
  here is what my HTML code looks like with multiple error messages:
 
  p
  label for=email
  E-mail
  /label
input class=text-input medium-input input-notification error
  png_bg name=client[email] id=email value={EMAIL} size=25
  span class=errorValidate generated=true htmlfor=email
  This field is mandatory
  /span
  span class=errorValidate generated=true htmlfor=email
  This field is mandatory
  /span
  span class=errorValidate generated=true htmlfor=email
  This field is mandatory
  /span
  span class=errorValidate generated=true htmlfor=email
  This field is mandatory
  /span
  span class=errorValidate generated=true htmlfor=email
  Please enter a valid e-mail address
  /span
  /p
 
  CSS:
 
  .errorValidate {
  padding: 2px 0 2px 22px;
  margin: 0 0 0 5px;
  }
 
  JS:
 
  var validateForm = $(#clientUpdateForm).validate(
  {
 errorClass: errorValidate,
 /etc/...
 
  }
 
  Any ideas why it would do that?
 
  Thanks in advance!



Re: [jQuery] Re: validate - error messages keep piling up

2009-12-16 Thread Jörn Zaefferer
At least post your full JS codes instead of just excerpts.

Jörn

On Wed, Dec 16, 2009 at 3:54 PM, Mark Livingstone namematters...@msn.comwrote:

 Jörn , it's hard to extract the code and make it functional just for
 jsbin.com

 Basically, the validation plug-in APPENDS span element that contains
 the error message right after the input field. When another message
 appears, it appends it again instead of first removing the initial
 message.

 My workaround is ugly but does the job:

onkeyup: function(element)
{
$(element).next().remove();
},
focusInvalid: false,
invalidHandler: function()
{
$(span).each(function(){ if($(this).attr(class) ==
 input-
 notification error png_bg) { $(this).remove(); } });
},
onfocusout: function(element)
{
$(element).next().remove();
$(span).each(function(){ if($(this).next().attr(class)
 == input-
 notification error png_bg) { $(this).next().remove(); } });
},

 This basically shows error messages only when the form is submitted.
 When the input field is in focus, it removes the error message. The
 onfocusout option removes repeated messages.

 I just can't figure out why it would behave this way.

 On Dec 16, 8:58 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
  Could you provide a full example, eg. via jsbin.com?
 
  Jörn
 
  On Wed, Dec 16, 2009 at 2:53 PM, Mark Livingstone 
 namematters...@msn.comwrote:
 
   anyone? :)
 
   On Dec 15, 12:37 pm, Mark Livingstone namematters...@msn.com wrote:
Hi,
 
Since I moved to a new design I cannot figure out how to stop the
validate plug-in to append error messages and instead have it remove
the previous error message before creating another one.
 
here is what my HTML code looks like with multiple error messages:
 
p
label for=email
E-mail
/label
  input class=text-input medium-input input-notification error
png_bg name=client[email] id=email value={EMAIL} size=25
span class=errorValidate generated=true htmlfor=email
This field is mandatory
/span
span class=errorValidate generated=true htmlfor=email
This field is mandatory
/span
span class=errorValidate generated=true htmlfor=email
This field is mandatory
/span
span class=errorValidate generated=true htmlfor=email
This field is mandatory
/span
span class=errorValidate generated=true htmlfor=email
Please enter a valid e-mail address
/span
/p
 
CSS:
 
.errorValidate {
padding: 2px 0 2px 22px;
margin: 0 0 0 5px;
}
 
JS:
 
var validateForm = $(#clientUpdateForm).validate(
{
   errorClass: errorValidate,
   /etc/...
 
}
 
Any ideas why it would do that?
 
Thanks in advance!



Re: [jQuery] (validate)

2009-12-16 Thread Jörn Zaefferer
Without seeing any of your code is pure guesswork to help you find the
issue. I need to see at least the code configuring the validation plugin.

Jörn

2009/12/16 eimantas enc.c...@gmail.com

 Hi guys

 I'm having trouble with validation plugin from bassistance.de. I have
 custom handlers for errorPlacement, highlight and unhighlight events.
 I also have defined custom errorElement. Error messages and validation
 data is extracted via metadata plugin using html5 data-* attributes.

 The problem is that if I define custom errorClass (which i need for
 error message elements), the error gets added each time the field is
 unfocused and left blank after first validation. For example:

 1) I open form and try to submit it;
 2) Errors are displayed;
 3) I focus/blur errored field;
 4) the error for that field is added again;

 Any help would be appreciated without disclosing lots of mine code .)

 Thank you in advance for taking time to answer my call for help!



Re: [jQuery] Re: validate - error messages keep piling up

2009-12-16 Thread Jörn Zaefferer
You have three classes specified for the errorClass. The plugin can't handle
that. If you actually need more then one class, use the highlight and
unhighlight options to add and remove those.

Jörn

On Wed, Dec 16, 2009 at 4:43 PM, Mark Livingstone namematters...@msn.comwrote:

 On Dec 16, 9:59 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:

  At least post your full JS codes instead of just excerpts.

  Jörn

 http://jsbin.com/isuco/edit

 I can e-mail you the link to my working page if that will help.
 Unfortunately I cannot share it here.



Re: [jQuery] [validate] show status indicator while conducting a remote validation

2009-12-11 Thread Jörn Zaefferer
The plugin currently doesn't provide any callbacks for that, but you can use
jQuery's ajax events: http://docs.jquery.com/Ajax_Events

Jörn

On Fri, Dec 11, 2009 at 1:27 AM, Marc marc.ga...@gmail.com wrote:

 Hi,
  I was wondering if it's possible to show an icon or label while the
 Validate plugin (http://docs.jquery.com/Plugins/Validation) is waiting
 on the response from a Remote rule. Ideally I would like to show a
 progress indicator to inform the user that the element is being
 validated in case of a slow connection or slow server response time.


 cheers,

 Marc.



Re: [jQuery] [Validation]

2009-12-10 Thread Jörn Zaefferer
The plugin in use there is
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
You already had the link to the plugin's documentation.
The Marketo-Demo is included in the Download, with all CSS and JS files. I
recommend you look at those, and come back here with more specific
questions.

Jörn

On Wed, Dec 9, 2009 at 3:16 AM, SEMMatt2 mattluk...@gmail.com wrote:

 I saw the Marketo implementation of the Jquery Validation module at
 http://docs.jquery.com/Plugins/Validation and I really like
 it;specifically how it highlights the form fields and displays one
 simple message at the top.

 In fact I would like to implement it on a Salesforce.com Web To Lead
 form that I am building at my job.

 However I would really appreciate a little help with the code
 structure as there is no documentation with it and I'm not an expert
 yet. However I'm a bit familiar with Jquery having used it a few times
 before. Here are my questions with this:

 What J Query libraries do I have to incorporate on the page and were
 can I
 find them?

 Does this work using regular client side validation because I don't
 see any
 onsubmit functions that are activating the validation?

 The CSS seems to be important..can you tell me where it is so that I
 can
 look at it.

 I would truly appreciate any help that you can offer in helping us
 implement this nice ititeration of Jquery Validation.

 Matt



Re: [jQuery] [validate] Error using rules('remove')

2009-12-05 Thread Jörn Zaefferer
The rules method applies to individual elements, not the whole form. Call it
directly on the age-field, and it should work.

Jörn

On Fri, Dec 4, 2009 at 1:34 PM, Eva eva.villarr...@gmail.com wrote:

 Hi all,

 I get an error when using rules('remove') from Jörn Zaefferer's
 Validate plugin.

 The error is:

 elem is undefined
 [Break on this error] var id = elem[ expando ];\r\n

 The code is:

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
 html
 head
  script src=http://code.jquery.com/jquery-latest.js;/script

  script
  $(document).ready(function(){
$(#myform).validate({
rules: {
'fname': required,
'lname': { required: true }
  },
  messages: {
'fname': Name is required,
'lname': Lastname is required
  },   errorLabelContainer: #messageBox,
   wrapper: li,
   submitHandler: function() { alert(Submitted!) }
 })
  });
  /script

  script
function change() {
alert('changing rules');
$(#myform).rules('remove');
$(#myform).rules('add', {
'age': {
required : true,
messages : {
 required: Age required}
 }
 }
  );
}
  /script

 /head
 body
  script type=text/javascript src=http://dev.jquery.com/view/trunk/
 plugins/validate/jquery.validate.jshttp://dev.jquery.com/view/trunk/%0Aplugins/validate/jquery.validate.js
 /script
 ul id=messageBox/ul
  form id=myform action=/login method=post
   labelFirstname/label
   input name=fname /
   labelLastname/label
   input name=lname /
   labelAge/label
   input name=age /
   labelAdress/label
   input name=address /
   br/
   input type=submit value=Submit/
   input type=submit value=Other Submit onclick=change();/
  /form
 /body
 /html


 I've missed something or it's a bug in the plugin?

 Thanks in advance.




Re: [jQuery] Validate - date() Question from plug-in via bassistance.de

2009-12-05 Thread Jörn Zaefferer
Its been an outstanding issue for a long time. There are too many possible
approaches to tackle it, and I couldn't yet decide on one to implement. Date
parsing and validating is something I'd rather see in an extra library, with
a leightweight custom method for the validate plugin to delegate to it.
datejs was an option, but it would add quite a lot of overhead...

Suggestions are welcome.

Jörn

On Tue, Dec 1, 2009 at 3:41 PM, Eclectic Mix eclectic...@gmail.com wrote:

 The plug-in validates for the correct date format, but does not
 validate the date itself (2/31/2009 shows as valid).  Will this be
 added at some point or should I use another plug-in to validate the
 date.

 Thanks -

 george



Re: [jQuery] Re: jQuery Validate using input type=image

2009-11-30 Thread Jörn Zaefferer
Styling buttons is quite flexible. Start with border:none, the rest should
be easy.

Jörn

On Mon, Nov 30, 2009 at 12:51 PM, Rich reholme...@googlemail.com wrote:

 Thanks that does pass the required value but I'll need to play around
 with styling the button as I don't want the image to appear as an icon
 and not as a button.

 Thanks

 On Nov 27, 5:20 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
  The plugin handles that case, though only for type=submit. You could
 try
  using a button instead:
 
  button type=submitimg ... //button
 
  JörnOn Fri, Nov 27, 2009 at 12:52 PM, Rich reholme...@googlemail.com
 wrote:
   I am validating a form that is submitted by an image input (input
   type=image), there are 3 of these inputs which either publish, save or
   delete the form details. If I turn javascript off and submit the form
   I can pick up the value of the input button used. i.e. request.form
   (publish.x) = ?, if I turn javascript on and use the jQuery validate
   plugin it does everything excpet pass the value of the button pressed
   so I can't detect which button has been pressed. Any help appreciated.
 
   [code]
   $(function() {
  $(#vml_library).validate({
  ignore: input[type=hidden],
  rules: {
  mName: {
  required: true
  },
  mSummary: {
  maxlength: 200
  },
  mDescription: {
  required: true
  },
  mFile: {
  required: true,
  accept:
   +$(input[name=typeList]).val().replace(/\'/g,
   '').replace(/\./g, '').replace(/,/g, '|') +
  },
  tFile: {
  required: function(element) {
  return
 $(input[name=vType]).val()
1;
  },
  accept: true
  }
  },
  messages: {
  mName: {
  required: Required
  },
  mFile: {
  required: Required,
  accept: Invalid File, must be  +
   $(input[name=typeList]).val()
  },
  mSummary: {
  maxlength: You may not use anymore than
 200
   characters
  },
  mDescription: {
  required: Required
  },
  tFile: {
  required: Required,
  accept: Invalid File, must be '.jpg',
   '.jpeg', '.gif' or '.png'
  }
  },
  success: function(label) {
  label.addClass(valid).text(OK!);
  },
  highlight: function(element, errorClass) {
  $(element).addClass(errorInput);
  },
  unhighlight: function(element, errorClass) {
  $(element).removeClass(errorInput);
  },
  submitHandler: function(form) {
  ShowProgress();
  form.submit();
  }
  });
 
   });
   [/code]



Re: [jQuery] jquery autosuggest with spinner

2009-11-29 Thread Jörn Zaefferer
Try specifying a style for the loading class, which gets added to the input
whenever a request is pending:

input.loading { background: indicator.gif }

Jörn

On Sun, Nov 29, 2009 at 11:09 PM, Christine Al-Thifairy
jolia...@gmail.comwrote:

 Hi,

 I am using the jQuery autocomplete plug-in 1.1 but it doesn't appear
 to support the display of spinner. I would like to know if there is
 any way to achieve the showing and hiding of a spinner, or of any
 other jQuery autocomplete plugin that comes with a spinner option. I
 have a few seconds delay in my application the first time the user
 starts to type in the autosuggest field. It would be nice to have a
 spinner as an indicator for the end user.

 cheers,

 christine




Re: [jQuery] jQuery Validate using input type=image

2009-11-27 Thread Jörn Zaefferer
The plugin handles that case, though only for type=submit. You could try
using a button instead:

button type=submitimg ... //button

Jörn

On Fri, Nov 27, 2009 at 12:52 PM, Rich reholme...@googlemail.com wrote:

 I am validating a form that is submitted by an image input (input
 type=image), there are 3 of these inputs which either publish, save or
 delete the form details. If I turn javascript off and submit the form
 I can pick up the value of the input button used. i.e. request.form
 (publish.x) = ?, if I turn javascript on and use the jQuery validate
 plugin it does everything excpet pass the value of the button pressed
 so I can't detect which button has been pressed. Any help appreciated.

 [code]
 $(function() {
$(#vml_library).validate({
ignore: input[type=hidden],
rules: {
mName: {
required: true
},
mSummary: {
maxlength: 200
},
mDescription: {
required: true
},
mFile: {
required: true,
accept:
 +$(input[name=typeList]).val().replace(/\'/g,
 '').replace(/\./g, '').replace(/,/g, '|') +
},
tFile: {
required: function(element) {
return $(input[name=vType]).val()
  1;
},
accept: true
}
},
messages: {
mName: {
required: Required
},
mFile: {
required: Required,
accept: Invalid File, must be  +
 $(input[name=typeList]).val()
},
mSummary: {
maxlength: You may not use anymore than 200
 characters
},
mDescription: {
required: Required
},
tFile: {
required: Required,
accept: Invalid File, must be '.jpg',
 '.jpeg', '.gif' or '.png'
}
},
success: function(label) {
label.addClass(valid).text(OK!);
},
highlight: function(element, errorClass) {
$(element).addClass(errorInput);
},
unhighlight: function(element, errorClass) {
$(element).removeClass(errorInput);
},
submitHandler: function(form) {
ShowProgress();
form.submit();
}
});

 });
 [/code]



Re: [jQuery] [validate] Specifying custom highlight/unhighlight methods problem

2009-11-26 Thread Jörn Zaefferer
The validation plugin hides labels based on the error class. By adding that
class to your regular label, it'll get hidden, too. Try using a different
class for the regular label (with the same styles).

Jörn

On Wed, Nov 25, 2009 at 4:35 PM, Imre Farkas farkasimr...@gmail.com wrote:

 I'm trying to specify a couple of custom methods for highlighting/
 unhighlighting valid/invalid fields on my form, but I'm getting some
 strange behaviour, which I'm not sure is due to me misunderstanding
 how these methods are supposed to be implemented, or if it's just
 buggy.

 $().ready(function() {
// validate signup form on keyup and submit
$(#contactForm).validate({
showErrors: function(errorMap, errorList) {
$(#result).html('span class=errors/spanspan
 class=msgPlease check/fill the marked fields/span !');
this.defaultShowErrors();
},
highlight: function(element, errorClass) {
 $(element.form).find(label[for= + element.id +
 ]).addClass
 (errorClass);
  },
unhighlight: function(element, errorClass) {
 $(element.form).find(label[for= + element.id +
 ]).removeClass
 (errorClass);
  },
rules: {
name: required,
email: {
required: true,
email: true
}
}
});
 });
 My problem is when some of inputs in invalid, then the label will take
 the error class, will be turn on red, when I correct the content of
 input my label disapear,  I have also the valid class, in my css
 file, what colud be the problem

 I hope You understand what I mean;



Re: [jQuery] Validate / Remote

2009-11-26 Thread Jörn Zaefferer
That script will get a single GET paremter with the name of the field as the
key and the value of the field as the value, here you'd get
verifica_user.php?cusuario=username

Jörn

On Thu, Nov 26, 2009 at 1:30 PM, RCLumbriga ronanl...@gmail.com wrote:

 Hi..  Sory the really bad english

 I have one problem with remote in Jquery.validate

 I do this

  cusuario:{
required: true, minlength: 5,
remote: verifica_user.php
},

 Now  i whant know how the script verifica_user.php will recive the
 information..

 
 I still trying make one script when any user go create on account,,
 first will verify if this account exist. If exist will appear on
 message.. This accound still in use. Please choice another..

 But i don't know how get the user still typing and pass from php
 script, where will do this comparation..

 Thanks



Re: [jQuery] Validate: more info on options

2009-11-25 Thread Jörn Zaefferer
The documentation for the plugin is here:
http://docs.jquery.com/Plugins/Validation
That includes documentation for the rules() method as well as descriptions
for all built-in validation methods (
http://docs.jquery.com/Plugins/Validation#List_of_built-in_Validation_methods
).

Jörn

On Wed, Nov 25, 2009 at 3:26 PM, Andre Polykanine an...@arthaelon.netwrote:

 Hello everyone,

 I decided to use the Validate plugin as suggested by many of you here.
 But either I can't read, or I can't search, but I didn't manage to
 find a description or a user guide for the options used by Rules()
 method, for example. I have seen required, email, equalTo, and
 minlength.
 Where could I read about that?
 Thanks!

 --
 With best regards from Ukraine,
 Andre
 Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @
 jabber.org
 Yahoo! messenger: andre.polykanine; ICQ: 191749952
 Twitter: m_elensule




Re: [jQuery] Validation Question

2009-11-24 Thread Jörn Zaefferer
Only fields present in the form are validated. Rules not matching any
element are ignored, so yes, you can just merge those.

Jörn

On Wed, Nov 25, 2009 at 12:24 AM, Dave Maharaj :: WidePixels.com 
d...@widepixels.com wrote:

 I submit my form , check valid, valid then away it goes.

 I was wondering 1 thing. I have

 $(this).validate(validate_awards);
   var valid = $(this).valid();
   if (valid) {
do my stuff
 }

 Now I have validate_awards which contains my rules for validation

 var validate_awards = {
  keyup: true,
  rules: {
  data[Award][title]:{required:true},
  data[Award][description]:{required:true,minlength: 25},
  data[Award][year]:{required:true}
  }
 };

 On another form same set up but validate_user is called to validate the
 user.

 Can I just group all of my validation rules into 1 var such as

 var validations = {
  keyup: true,
  rules: {
  data[Award][title]:{required:true},
  data[Award][description]:{required:true,minlength: 25},
  data[Award][year]:{required:true}
  data[User][fname]:{required:true},
  data[User][lname]:{required:true},
  data[User][age]:{required:true}

  }
 };

 and jquery will ignore any fields that are not present in the form being
 validated? Or when I validate my awards it will look for the User fields
 since its included in the validations rules?

 Thanks

 Dave




Re: [jQuery] Validation error placement

2009-11-18 Thread Jörn Zaefferer
Take a look at the milk-demo here:
http://jquery.bassistance.de/validate/demo/milk
The messages are placed in the column next to the input element, that should
be close to what you are looking for.

Jörn

2009/11/18 Atkinson, Sarah sarah.atkin...@cookmedical.com

  I am trying to put all my errors in a div that is the 3rd column. I
 then want to set there position so it is level with the element.
 But when I run it I get no error messages

 Here is my code:
   errorPlacement: function(error, element)  {
errordiv=$('.insidePage_error div');
  error.appendTo(errordiv);//var offset =
 $(element).offset();//error.css({'top' : offset.top, 'position' :
 'absolute' });   },



Re: [jQuery] Validation error placement

2009-11-18 Thread Jörn Zaefferer
Do you have only a single element? Then use the errorLabelContainer option.
Or one for each input? Then you need to make that selector relative to the
current input; currently you select the same div for each input.

Jörn

On Wed, Nov 18, 2009 at 7:29 PM, Atkinson, Sarah 
sarah.atkin...@cookmedical.com wrote:

  That’s actualy what I was looking at... But I’m not using a table layout.
 So instead I want them to go into a special error div with class
 “insidePage_error”
 And so I got these 2 lines

   errordiv=$('.insidePage_error div');  error.appendTo(errordiv);



 I also tried
 Errordiv.appendChild(error);
  but that didn’t work either

 On 11/18/09 12:00 PM, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:

 Take a look at the milk-demo here:
 http://jquery.bassistance.de/validate/demo/milk
 The messages are placed in the column next to the input element, that
 should be close to what you are looking for.

 Jörn

 2009/11/18 Atkinson, Sarah sarah.atkin...@cookmedical.com

 I am trying to put all my errors in a div that is the 3rd column. I then
 want to set there position so it is level with the element.
 But when I run it I get no error messages

 Here is my code:
   errorPlacement: function(error, element)   {
errordiv=$('.insidePage_error div');
  error.appendTo(errordiv); //var offset =
 $(element).offset();//error.css({'top' : offset.top, 'position' :
 'absolute' });   },






Re: [jQuery] Validation (groups, rules and messages)

2009-11-17 Thread Jörn Zaefferer
You need to specify the rules for each individual field, here firstname and
lastName. The group name doesn't have any meaning outside the groups-option
itself.

Jörn

On Tue, Nov 17, 2009 at 4:23 PM, Atkinson, Sarah 
sarah.atkin...@cookmedical.com wrote:

  I’m working with the validation plugin
 I have a first name and last name field and I want to have these grouped
 together with one message. This is what I have:
 But the message still isn’t showing.
   groups: {
fullName: firstname lastName,  },rules:{fullName:
 required,},messages:{fullName: Both first and last name
 are required,



Re: [jQuery] Validation (groups, rules and messages)

2009-11-17 Thread Jörn Zaefferer
It affects the message display, producing only a single error label for a
given group.

Jörn

On Tue, Nov 17, 2009 at 4:35 PM, Atkinson, Sarah 
sarah.atkin...@cookmedical.com wrote:


 So what exactly does the group option do?



 On 11/17/09 10:30 AM, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:

 You need to specify the rules for each individual field, here firstname and
 lastName. The group name doesn't have any meaning outside the groups-option
 itself.

 Jörn

 On Tue, Nov 17, 2009 at 4:23 PM, Atkinson, Sarah 
 sarah.atkin...@cookmedical.com wrote:

 I’m working with the validation plugin
 I have a first name and last name field and I want to have these grouped
 together with one message. This is what I have:
 But the message still isn’t showing.
   groups: {
fullName: firstname lastName,  },rules:{fullName:
 required, },messages:{fullName: Both first and last name
 are required,






Re: [jQuery] (validate) error in IE7

2009-11-17 Thread Jörn Zaefferer
Could you provide some code? A testpage? jsbin.com works great for that.

Jörn

On Tue, Nov 17, 2009 at 4:39 PM, dmikester1 dmikest...@gmail.com wrote:

 Here is the screenshot of the bug or error in IE7.  Can anyone help me
 figure this one out?
 http://www.michaelandregina.com/jqueryErrorInIE7.png
 Thanks
 Mike



Re: [jQuery] Validation and dropdowns

2009-11-17 Thread Jörn Zaefferer
Set the field as required and provide value= on the default option:
select class=requiredoption value=Please.../optionoption
value=.../option/select

Jörn

On Tue, Nov 17, 2009 at 7:57 PM, Atkinson, Sarah 
sarah.atkin...@cookmedical.com wrote:

  I have several dropdowns in my form. They start on a “please select one”
 state. How do I make it so that if one of these is selected then it does not
 trigger validation but kicks back an error?
  Sarah



Re: [jQuery] (validate) custom message for maxlength

2009-11-17 Thread Jörn Zaefferer
Sure:

messages: {
  comments: {
maxlength: function(max) {
  return 'Comments' must not exceed  + max +  characters. You entered
 + $(input[name=maxlength]).val().length +  characters;
}
  }
}

Jörn

On Tue, Nov 17, 2009 at 8:16 PM, Kasvis kasvis...@gmail.com wrote:

 Hi,

 I am trying to customize the message for maxlength rule.

 I want to show the current text length entered in the message
 something like this.

 'Comments' must not exceed 660 characters. You entered 754 characters

 Is there a way to create the message to include the current length.

 Thanks




Re: [jQuery] Allow submit to proceed despite validation errors?

2009-11-13 Thread Jörn Zaefferer
Maybe not the solution you're looking for, but easy enough to give it a try:
By adding a class of cancel to a save anyway-submit-button, the
validation is skipped and the form submitted.

Jörn

On Fri, Nov 13, 2009 at 7:45 AM, Jim Biancolo j...@biancolo.com wrote:

 Hi folks,

 Short version:  is there code I can put in invalidHandler that will
 allow the submit to proceed, even if there are validation errors in
 the form?  (note that form.submit() does not seem to be the answer)

 Long version: I have a situation where my client wants all the visual
 validation cues, but still wants the user to be able to submit an
 invalid form so that it can be saved to the database to be resumed
 later.  I'm struggling with this using the validation plugin, as it
 doesn't want to allow the submit to happen if there are any validation
 errors.  Is there a way to force it to proceed?  I thought this bit
 from the too much recursion section of the help would do it:

 $(#myform).validate({
  submitHandler: function(form) {
   form.submit();
  }
 });

 I figured if form.submit() could be called from submitHandler, then it
 could also be called from invalidHandler, but it doesn't appear so.  I
 get a Firebug error telling me form.submit() doesn't exist.  Now, as
 it happens, the submit rams through anyway, which I could live with,
 but having this code here causes other problems, like when I call
 validator.form() I get the same undefined error, and it prevents all
 subsequent validations from happening.

 Any ideas?

 Thanks!

 Jim



Re: [jQuery] Validation Plugin + jNice

2009-11-13 Thread Jörn Zaefferer
Do you have a testpage?

Jörn

On Fri, Nov 13, 2009 at 4:40 PM, Samuurai djbe...@gmail.com wrote:

 I'm having a strange problem with jNice and the validation plugin.

 Probably the easiest way to describe the error is by giving an
 example.

 I load the page with my form on it, then without typing anything, I
 click submit. The jQuery validation plugin puts errors around my
 fields saying This field is required.

 However, when I try to type something into the input fields to satisfy
 the validation, I can type a couple of letters, three or four if i'm
 really fast, but as the validation plugin removes the error box, it
 shifts focus away from the input box.

 Strangely, this same behaviour continues on the same field even after
 the error box has been removed.. the focus gets 'stolen'.

 Has anyone had any experience using jQuery validation plugin with
 jNice?



Re: [jQuery] Re: Validation Plugin + jNice

2009-11-13 Thread Jörn Zaefferer
Looks like jNice is causing that issue. Did you try removing that to see
what happens?

Jörn

On Fri, Nov 13, 2009 at 4:58 PM, Samuurai djbe...@gmail.com wrote:

 Yeah..

 www.racedaystaff.com - log in as jorn/jorn then click proceed to
 site then click register at the top.

 Thanks for looking at this !

 On Nov 13, 3:51 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
  Do you have a testpage?
 
  Jörn
 
  On Fri, Nov 13, 2009 at 4:40 PM, Samuurai djbe...@gmail.com wrote:
   I'm having a strange problem with jNice and the validation plugin.
 
   Probably the easiest way to describe the error is by giving an
   example.
 
   I load the page with my form on it, then without typing anything, I
   click submit. The jQuery validation plugin puts errors around my
   fields saying This field is required.
 
   However, when I try to type something into the input fields to satisfy
   the validation, I can type a couple of letters, three or four if i'm
   really fast, but as the validation plugin removes the error box, it
   shifts focus away from the input box.
 
   Strangely, this same behaviour continues on the same field even after
   the error box has been removed.. the focus gets 'stolen'.
 
   Has anyone had any experience using jQuery validation plugin with
   jNice?



Re: [jQuery] Re: Validation Plugin + jNice

2009-11-13 Thread Jörn Zaefferer
Then this:

,success: function(element){
157 var errorDiv = element.parents('.error');
158 element.remove();
159 errorDiv.siblings().remove();
160 errorDiv.replaceWith(errorDiv.children());
161 }

You replace the div? That causing the DOM to rerender, including the input,
killing the focus.

Jörn


On Fri, Nov 13, 2009 at 6:17 PM, Samuurai djbe...@gmail.com wrote:

 Strangely, It seems to be doing it even after removing jNice. - I've
 updated the test site.

 On Nov 13, 4:23 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
  Looks like jNice is causing that issue. Did you try removing that to see
  what happens?
 
  Jörn
 
  On Fri, Nov 13, 2009 at 4:58 PM, Samuurai djbe...@gmail.com wrote:
   Yeah..
 
  www.racedaystaff.com- log in as jorn/jorn then click proceed to
   site then click register at the top.
 
   Thanks for looking at this !
 
   On Nov 13, 3:51 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
   wrote:
Do you have a testpage?
 
Jörn
 
On Fri, Nov 13, 2009 at 4:40 PM, Samuurai djbe...@gmail.com wrote:
 I'm having a strange problem with jNice and the validation plugin.
 
 Probably the easiest way to describe the error is by giving an
 example.
 
 I load the page with my form on it, then without typing anything, I
 click submit. The jQuery validation plugin puts errors around my
 fields saying This field is required.
 
 However, when I try to type something into the input fields to
 satisfy
 the validation, I can type a couple of letters, three or four if
 i'm
 really fast, but as the validation plugin removes the error box, it
 shifts focus away from the input box.
 
 Strangely, this same behaviour continues on the same field even
 after
 the error box has been removed.. the focus gets 'stolen'.
 
 Has anyone had any experience using jQuery validation plugin with
 jNice?



Re: [jQuery] Issues with jQuery plugins

2009-11-12 Thread Jörn Zaefferer
Sounds like the includes aren't working, maybe base_url() returns the wrong
value. Do a View Source to see how the URLs of those script tags look like.
Or use Firebug's Net panel to check that there are no 404s.

Jörn

On Thu, Nov 12, 2009 at 4:50 PM, Paulo Henrique paulode...@gmail.comwrote:

 Hello all... I am working on a php website, and I am using jquery and some
 plugins I use on all my websites...
 The problem is that I am doing exactly the same thing I do in every
 website, but it suddenlly stopped working on this one...
 The jquery works fine, I tried a command, the problem is with the
 plugins... When I call a plugin, no matter which one,
 an error message always says that the function doesn't exists... But the
 same code on other website seems to work just
 fine... here are a sample of my codes:

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN 
 http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 meta http-equiv=Content-Type content=text/html; charset=utf-8 /
 title::  ::/title
 link href=?php echo base_url(); ?css/style.css rel=stylesheet
 type=text/css /
 link href=?php echo base_url(); ?css/layout.css rel=stylesheet
 type=text/css /
 link href=?php echo base_url(); ?css/thickbox.css rel=stylesheet
 type=text/css /
 link href=?php echo base_url(); ?css/jquery.tooltip.css
 rel=stylesheet type=text/css /
 script language=javaScript type=text/javaScript
 window.section = '?php echo $id; ?';
 /script
 script language=javascript type=text/javascript src=?php echo
 base_url(); ?js/jquery.js/script
 script language=javascript type=text/javascript src=?php echo
 base_url(); ?js/status.js/script
 script language=javascript type=text/javascript src=?php echo
 base_url();?js/jquery.editable-1.3.3.js/script
 script language=javascript type=text/javascript src=?php echo
 base_url();?js/thickbox.js/script
 script language=javascript type=text/javascript src=?php echo
 base_url();?js/jquery-ui-1.7.1.custom.min.js/script
 script language=javascript type=text/javascript src=?php echo
 base_url();?js/jquery.tooltip.js/script
 script language=javascript type=text/javascript src=?php echo
 base_url();?js/jquery.bgiframe.js/script
 script language=javascript type=text/javascript src=?php echo
 base_url();?js/jquery.delegate.js/script
 script language=javascript type=text/javascript src=?php echo
 base_url();?js/jquery.dimensions.js/script
 script language=javaScript type=text/javaScript
 var success = true;
 $(document).ready(function() {
$('#sortable').sortable({
'opacity': 0.7,
'revert': true,
'scroll': true,
'handle': $(.imagecontainer).add(.imagecontainer a img),
'update': 'updated'
});
$('#sortable').disableSelection();
$('.thumb').tooltip({
 delay: 3,
 showURL: false,
 bodyHandler: function() {
 return $(img/).attr(src, this.src);
 }
 });
});


 Then I get an error message saying that sortable is not a function If
 I remove this code, then it would say disableSelection is not a function,
 and tooltip is not a function, after that...

 Does anyone here might know what's going on? I can't think of anything
 else =/

 Att.
 Paulo Henrique Vieira Neves
 Bsc. Sistemas de Informação
 +55 38 9141 5400
 MSN: paulode...@live.com
 GTALK: paulode...@gmail.com
 SKYPE: paulodemoc



Re: [jQuery] (validation) Validation plugin submitHandler

2009-11-12 Thread Jörn Zaefferer
Use a different name for the submit-button. Using name=submit you override
the actual submit-function of the form. Keep in mind that in the DOM API,
you can access any form element as a property of the form, referenced by
name.

Jörn

On Thu, Nov 12, 2009 at 8:48 PM, mcrawford mcrawf...@gmail.com wrote:

 I'm totally stumped with the submitHandler. Here is my test page, down
 below. I'm using PHP just to print out the form variables but
 obviously you could adapt the HTML for anything.

 Notice that I have set my Submit button to have name=submit which
 means that, in the submitHandler, form.submit() is not a function. I
 get a JavaScript error on that line, but (and this is what I can't
 figure out), the form still submits.

 I can change the Submit button to have a different name, like
 name=sbmt. That avoids the JS error on the form.submit() line. But
 then (and I don't get this either), if you click the Cancel button,
 that value of cancel=Cancel will not get sent in the post. With the
 Submit button named submit the cancel=Cancel gets posted correctly
 when you click on that button.

 ?php
 if (!empty($_POST)) {
print_r($_POST);
 }
 ?

 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
head
titleTEST/title
meta http-equiv=Content-Type content=text/html;
 charset=utf-8/
script type=text/javascript
 src=/js/jquery-1.3.2.js/script
script type=text/javascript src=/js/jquery-validate/
 jquery.validate.js/script
/head
body
form action=test-validate.php method=post
 id=the-form
input type=hidden name=hidden
 value=something/
input class=button type=submit name=submit
 value=Do it
 now!/
input class=button cancel type=submit
 name=cancel
 value=Cancel/
/form
script type=text/javascript
$(function() {
// VALIDATION
$(#the-form).validate({
submitHandler: function(form) {
$('input[name=submit]',
 '#the-form').attr('disabled',
 'disabled');
form.submit();
}
});
});
/script
/body
 /html




Re: [jQuery] (validate) Customising bassistance validation plugin

2009-11-07 Thread Jörn Zaefferer
The plugin by default picks up attributes, so if you're using attribute
names that match validation plugin methods, it should work like that. Though
you may need to also provide a value, ala required=true, not sure about
that.

Jörn

On Sat, Nov 7, 2009 at 6:21 AM, Iwan Vosloo i...@reahl.org wrote:

 Hello,

 We are trying to use the validation plugin with HTML that's been
 generated for us.  There are a couple of things we'd like to customise
 if we can for the plugin to work with this HTML.

 One of them is that the code uses some HTML5 conventions - like how to
 specify when an input is required:

 Usually you'll have something like:
 input type=text class=required

 In our HTML, we'd have:
 input type=text required

 Is there a way to customise/configure the validation plugin to
 recognise the latter?

 Thanks
 - Iwan



[jQuery] Re: jQuery Validation - ajax check for email

2009-10-21 Thread Jörn Zaefferer
The method has to return something else then undefined. You can use the
remote-method instead, it allows you to do remote checks:
http://docs.jquery.com/Plugins/Validation/Methods/remote

Jörn

On Wed, Oct 21, 2009 at 2:12 PM, Samuurai djbe...@gmail.com wrote:


 Hi,

 This is my first attempt at using addMethod and it's always returning
 true, for some reason.

 This is placed outside of document.ready

 jQuery.validator.addMethod(checkemail, function(email) {
var email = $('#email').val();
$.post(user/checkemail, { email : email },
function(data){
if(data.exists == 1)
{
return true;
}
}, json );
}, 'This email already has already been registered');

 and in the validate() method, I'm calling the function like this:

 rules:{
email: {
required: true,
email: true,
checkemail: true
}
 }

 Is there anything obvious i'm doing wrong here?

 Thanks!


[jQuery] Re: password initial value without masking ****

2009-10-19 Thread Jörn Zaefferer
Instead of replacing the input, display a label above it. See
http://wiki.jqueryui.com/Watermark

Jörn

On Mon, Oct 19, 2009 at 4:17 PM, Liam Potter radioactiv...@gmail.comwrote:


 Here is how I do it. Just markup the form like normal (I use a definition
 list to lay out my forms)

   $(input:password).each(function(){
   var $currentPass = $(this)
   $currentPass.css({opacity:0});
 $currentPass.before('input type=text value=Password
 class=removeit style=position:absolute;z-index:10; /');
 var $visiblePassword = $(.removeit);
 $visiblePassword.focus(function () {
   $(this).css({opacity:0});
   $currentPass.focus().css({opacity:1});
   });
 $currentPass.blur( function () {
   if ( $currentPass.attr(value) ==  ){
   $currentPass.css({opacity:0});
   $visiblePassword.css({opacity:1}).attr(value,Password);
   }
   });
   });

 waseem sabjee wrote:

 ah yes i forgot.

 you would get access denied when tried to change an input type property

 the best way is to have two input types and just hide one and show the
 other

 but i have a solution for you
 the html

!-- The following html of two input types - we gonna switch
 between them--
input type=text class=textinput value=Passowrd /
input type=password class=passinput value= /

 the css

style type=text/css
/*first we need to hide the password input*/
.passinput {
display:none;
}
/style

 the js

script type=text/javascript
$(function() {
// declare your input types
var textinput = $(.textinput);
var passinput = $(.passinput);
// on text input focus - hide text input and show and focus
 on password input
textinput.focus() {
textinput.blur();
textinput.hide();
passinput.show();
passinput.focus();
});
// on password input blud hide password input and show and
 focus on text input
passinput.blur(function() {
passinput.blur();
passinput.hide();
textinput.show();
textinput.focus();
});
});
/script

 On Mon, Oct 19, 2009 at 2:51 PM, Marco Barbosa 
 marco.barbos...@gmail.commailto:
 marco.barbos...@gmail.com wrote:


Hi waseem!

Thanks for your reply.

Something's wrong with this line:
$(#password).attr({type:'text'});

I tried changing to:
$(#password).attr('type','text'});

but still no go.
I have to comment out to get the other JS stuff on the site working.

The rest of the code seems Ok. What could it be?

I like your solution, pretty simple :)

I was wondering if we could put this inside the cleanField function
but I guess it's not necessary.

~Marco


On Oct 19, 2:32 pm, waseem sabjee waseemsab...@gmail.com
mailto:waseemsab...@gmail.com wrote:
 // set the initial type to text
 $(.mypasswordfield).attr({
   type:'text'

 });

 // on user focus - change type to password
 $(.mypasswordfield).focus(function() {
  $(.mypasswordfield).attr({
type:'password'
  });

 });

 // on user blur - change type to back to text
 $(.mypasswordfield).blur(function() {
  $(.mypasswordfield).attr({
type:'text'
  });

 });

 since text is an attribute we can change it.
 all im doing is changing the type between password and text on
click and on
 blur
 let me know if this worked for you :)

 On Mon, Oct 19, 2009 at 11:21 AM, Marco Barbosa
 marco.barbos...@gmail.com mailto:marco.barbos...@gmail.comwrote:






  Hi!

  I'm trying to achieve something like the Facebook first page (when
  you're not logged in).

  I'm using this simple function/plugin to clean the fields once you
  click them:
  $.fn.cleanField = function() {
 return this.focus(function() {
 if( this.value == this.defaultValue ) {
 this.value = ;
 }
 }).blur(function() {
 if( !this.value.length ) {
 this.value = this.defaultValue;
 }
 });
  };
  // clean the fields
  $(#login).cleanField();
  $(#password).cleanField();

  So If I click Login or Password, it will clean and the user
can type
  the new value.
  It works good but there's a little usability problem here.

  I want to display the Password field like: Your password here
  instead of ***
  But when the user types his/her password, it has to go 

[jQuery] Re: Create a custom rule

2009-10-19 Thread Jörn Zaefferer
The first argument, value, refers to the actual value-attribute. You'll
probably want to use the third argument, eg. param:


$.validator.addMethod('hasClass', function(value, element, param) {
reurn $(element).hasClass(param); }, jQuery.format('Please check the
button'));


Also a bit simpler with a single return.

Jörn

On Mon, Oct 19, 2009 at 9:03 PM, Giovanni Battista Lenoci gian...@gmail.com
 wrote:

  Hi, I'm trying to create a new validation rule to check if a button has a
 class.

 I try to explain the scenario.

 I have a button that makes an ajax call to check the availability of a
 product.

 When the app loads the button as class to_check, when the button is
 clicked an ajax call is fired, a server script return the availability of
 the product and basing on this answer I change the class of the button from
 to_check to ok or ko.

 Now I want to validate the button to se if the availability is being
 checked and is ok, then I wrote this:

 $.validator.addMethod('hasClass', function(value, element) { 
 if($(element).hasClass(value)) {
return true;
  } else {
return false
  }
 }, 
 jQuery.format('Please check the button'));


 Now I want to add this rule to the button with the metadata plugin inside
 the class name with this syntax:

 input type=button name=verifica_disponibilita
  class=to_check {validate:{*hasClass:'ok'*, messages:{hasClass:'Verifica 
 disponibilitagrave;'}}}
  id=verifica_disponibilita value=Verifica disponibilitagrave; /


 When I submit the form it returns always false, I tried to log value and
 I get the button value.

 How I can get the ok passed via the metadata class? (bold one)

 Bye



 -- gianiaz.net - web solutions
 via piedo, 58 - 23020 tresivio (so) - italy
 +39 347 7196482




[jQuery] Re: (tooltip) Markup problem

2009-10-14 Thread Jörn Zaefferer
You could give the jQuery UI tooltip a try.

Source is here:
http://jquery-ui.googlecode.com/svn/branches/dev/ui/jquery.ui.tooltip.js
Theme:
http://jquery-ui.googlecode.com/svn/branches/dev/themes/base/ui.tooltip.css
Visual test (sort of demo) here:
http://jquery-ui.googlecode.com/svn/branches/dev/tests/visual/tooltip/default.html

Jörn

On Wed, Oct 14, 2009 at 1:55 PM, shapper mdmo...@gmail.com wrote:


 On Oct 12, 8:57 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
  That sounds like you validate a page for the sake of validation. I think
  thats beneath the point, therefore I don't get your argument. Do you
 worry
  about accessibility? If so, did you test the tooltip with a screenreader?
  Afaik thats the best way to test for accessibility; validation not so
 much.

 Jörn,

 I didn't talk about validation.

 Take the example I created here:
 http://flyonpages.flyondreams.pt/tooltip.html

 The document structure already contains a H3 header.
 IMHO it does not make sense to me the tooltip to add a header at same
 level ...

 I even think the tooltip shouldn't have a header ... But of course
 that is my opinion.
 But in this example, to use a header on tooltip, it should be a H4 ...
 agree?

 I really like the functionality of your plugin:
 For example, when tooltip disappears when a input is selected ...

 Would be possible to tell me how to change the plugin code so the
 tooltip would be just:
 divspanTitle ... spandiv

 And I need to display only the title ... no url in case of anchors.
 Just the title in all situations.

 Basically, a really simple tooltip but with the same behavior as
 yours.

 I have been looking for such a plugin but they never work as good as
 yours.

 And all my tries to adapt your code ended with a broken plugin ...

 Thank You,
 Miguel


[jQuery] Re: Accordion, there are too many

2009-10-13 Thread Jörn Zaefferer
Yes, wrap those p tags in a div, and your markup is perfect for the the
jQuery UI accordion.

Jörn

On Tue, Oct 13, 2009 at 3:00 AM, Scott Haneda talkli...@newgeo.com wrote:


 There are just too many accordions out there, can someone point me in the
 right direction.  This need not be fancy:

 div class=post
 h3title 1/h3
psome copy here/p
psome more copy here/p
pand some more copy here/p

 h3title 2/h3
psome copy here/p
psome more copy here/p
pand some more copy here/p

 h3title 3/h3
psome copy here/p
psome more copy here/p
pand some more copy here/p
 /div

 On load, I would want the all p's hidden, which are in the class post, or,
 if I could say all p's that are children of the h3's, but I am not sure
 technically, they are children.

 The first h3 of course should not be hidden.  On clicking any of the h3's,
 which I will href a link to '#' on, that one should go from hidden to shown.
  Clicking on any other h3, will toggle the one that is on, to off, and then
 turn the clicked one on.

 Basic, every example I find breaks in some way, or spends a lot of time
 prettying it up, which I do not need.   A final link at the bottom to
 expand all would be nice.

 About 80% of the examples out there fail on more than 1 p tag after the h3.
 I suppose I am going to have to wrap each in a set of divs?

 Thanks
 --
 Scott * If you contact me off list replace talklists@ with scott@ *




[jQuery] Re: (tooltip) Markup problem

2009-10-12 Thread Jörn Zaefferer
That sounds like you validate a page for the sake of validation. I think
thats beneath the point, therefore I don't get your argument. Do you worry
about accessibility? If so, did you test the tooltip with a screenreader?
Afaik thats the best way to test for accessibility; validation not so much.

Jörn

On Mon, Oct 12, 2009 at 5:49 PM, shapper mdmo...@gmail.com wrote:


 Hello,

 I have been using Bassistance tooltip but I think the markup is really
 incorrect.
 http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/

 Why forcing an H3 into the tooltip? Did you ever checked a page with
 it in Opera's table of contents?
 By imposing H3 you are breaking the semantics of a page ...

 At least you could allow to have an option to have the H3 or not ...

 What do you think?

 Thanks,
 Miguel




[jQuery] Re: Jquery autocomplete source code and instructions

2009-10-06 Thread Jörn Zaefferer
Right here: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/

Source (for now) is here:
http://bassistance-plugins.googlecode.com/svn/trunk/plugins/autocomplete/

Jörn

On Tue, Oct 6, 2009 at 8:36 AM, sangram sangramred...@gmail.com wrote:


 hi,

 i have used previous version of jquery autocomplete plugin.

 now i wanted to use the latest version of the plugin, but i am unable
 to find the source anywhere!

 i have checked the site, the link to SVN is also not working. where
 can i get the plugin and instructions to use it ?

 any help?

 regards



[jQuery] Re: Form Validation

2009-10-01 Thread Jörn Zaefferer

Take a look at the errorPlacement option, documented here:
http://docs.jquery.com/Plugins/Validation/validate#toptions

Jörn

On Thu, Oct 1, 2009 at 12:53 AM, Samuurai djbe...@gmail.com wrote:

 Hi,

 I have got some very rudimentary validation working with JQuery
 validation, however, by default, it creates some label tags with the
 error messages in them, right next to the input tags which have
 errors.

 How can I control where these error messages are displayed, as they're
 inside the same div as the input tag which is causing display issues.

 I'm very new to JQuery so please elaborate a little bit if you can.

 Thanks!

 B


[jQuery] Re: Form Validation

2009-10-01 Thread Jörn Zaefferer

Take a look at some of the demos, eg. the Remember The Milk demo:
http://jquery.bassistance.de/validate/demo/milk/

You can customize the error further with the errorElement and
errorClass options. The resulting element needs to have a
for-attribute pointing to the associated input, otherwise the plugin
can't update it later on.

Jörn

On Thu, Oct 1, 2009 at 5:27 PM, Samuurai djbe...@gmail.com wrote:

 I have just realised that you were the coder behind this -

 My apologies..I didn't realise the flexibility of errorPlacement.

 I got it working to a certain degree.. here's my code:

                ,errorPlacement: function(error,element){

                        $('[for='+element.attr(name)+']').parents('.grid-26')

                        .prepend('p'+error.text()+'/p')

                        .wrapInner('div class=error/div');

                }

 It applies the error and displays the message, but it infinitely
 applies the error, placing more and more divs around it. when I click
 on the input area and off it again. Also, how do I make it remove the
 errors?

 I thought it was using the success: method and using this code:
 var error = label.parents('.error');
 error.siblings().remove();
 error.replaceWith(error.children());

 But it didn't work basically I don't really know what I'm doing :)


 On Oct 1, 11:24 am, Samuurai djbe...@gmail.com wrote:
 Thanks Jorn I'm looking at that, however I think I've devised another
 method.

 I need this code to be run on each offending field:

         $('[for=name]').parents('.grid-26') // for=name is the selctor for
 the label.
                 .prepend('pPlease write your real name/p')
                 .wrapInner('div class=error/div');

 });

 I only really have a background in PHP, so in PHP terms, how do I do
 a    foreach ($errors as $error) and then call the above code with the
 selector and the error message?

 Thanks!

 Beren

 On Oct 1, 9:01 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:

  Take a look at the errorPlacement option, documented 
  here:http://docs.jquery.com/Plugins/Validation/validate#toptions

  Jörn

  On Thu, Oct 1, 2009 at 12:53 AM, Samuurai djbe...@gmail.com wrote:

   Hi,

   I have got some very rudimentary validation working with JQuery
   validation, however, by default, it creates some label tags with the
   error messages in them, right next to the input tags which have
   errors.

   How can I control where these error messages are displayed, as they're
   inside the same div as the input tag which is causing display issues.

   I'm very new to JQuery so please elaborate a little bit if you can.

   Thanks!

   B


[jQuery] Re: How to submit validated form?

2009-10-01 Thread Jörn Zaefferer

Try this:

submitHandler:function(form) {
form.submit();
}

Jörn

On Thu, Oct 1, 2009 at 11:07 PM, slimshady bringmewa...@gmail.com wrote:

 I am unable to submit the form after validation.  I have tried various
 ways to submit but my form action is not honored.  Thanks for any help

 http://codepad.org/yAqp0Nln


[jQuery] Re: ajaxQueue not aborting ajax calls with Autocomplete

2009-09-28 Thread Jörn Zaefferer

Can you provide a testpage?

Jörn

On Mon, Sep 28, 2009 at 7:59 PM, jmunning jasonmunn...@gmail.com wrote:

 Anyone have any ideas about this?  I'm stuck on this.

 Thanks

 On Sep 22, 2:47 pm, jmunning jasonmunn...@gmail.com wrote:
 Hi all,

 I am using the bassistance autcomplete plugin version 1.1 along with
 the bundled ajaxQueue.js file.

 When text is inputted into the autocomplete, it seems to be keeping
 the ajax calls open and loading even though they never resolve -- as
 shown by a loading indicator which is stuck and in the Firebug
 console.  It looks to me like the ajaxQueue plugin is supposed to fix
 this but it doesn't seem to be aborting.

 I can't for the life of me figure out what the problem is or how to
 resolve it.  Does anyone have suggestions of what I could look for?

 It seems to come down to this section in ajaxQueue.js:
 [code]
 case abort:
                         if ( pendingRequests[port] ) {
                                 pendingRequests[port].abort();
                         }
                         return pendingRequests[port] = ajax.apply(this, 
 arguments);

 [/code]

 If I put an if statement on the line containing the 'abort' command
 then I can see that that command is not completing.  Not sure why
 though.

 Here is my code:

 [code]
 $(#suggest).autocomplete('auto_data.php?table=patents', {
                 width: 557,
                 multiple: true,
                 multipleSeparator: \n,
                 matchSubset:false,  //setting this to false causes entries to
 disappear after selected
                 mustMatch: false,
                 max: 20,
                 delay: 0
         });

 [/code]

 And here is the site it is running on:
  http://www.xyggy.com

 Thanks for any help.


[jQuery] Re: Unlock Documentation

2009-09-24 Thread Jörn Zaefferer

As Karl mentioned, users registered for more then 24h can edit all
pages, with just a few exceptions, like the wiki homepage and the
About page.

So, could you guys be a bit more specific with your critique of
existing documentation?

Jörn

On Thu, Sep 24, 2009 at 7:57 AM, Scott Haneda talkli...@newgeo.com wrote:

 Wow, I thought I was the only one.  Has anyone looked at the form validation
 docs?  I thought it was a wiki style though?  No one can edit?
 --
 Scott * If you contact me off list replace talklists@ with scott@ *

 On Sep 23, 2009, at 9:21 PM, rickoshay wrote:

 The documentation is going to remain in its sorry state if they do not
 unlock it and allow competent technical writers to update it. There is
 no excuse, for example, for not describing the copy/move behavior of
 the append function. One in a mountain of necessary documentation
 updates.




[jQuery] Re: (validation) removal of error message problem

2009-09-23 Thread Jörn Zaefferer

Try this:

$(label[for='orders[4].elements[2].Value']).length

On Wed, Sep 23, 2009 at 3:17 PM, chief7 chi...@gmail.com wrote:

 i can't reproduce on a test page.  I updated to 1.5.5, but no change.

 the page in question is dynamically generated using AJAX data calls.

 i can see the error label in the js console:

$(label.error).length
 1
$(label.error).toHtml()
 LABEL class=error for=orders[4].elements[2].Value
 generated=trueOnly numeric values are permitted./LABEL

 but the 'for' attribute selector in the errorsFor method doesn't
 work.  it doesn't work from the console either:

$(label([for='orders[4].elements[2].Value'])).length
 0



 On Sep 22, 4:48 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
 Please update to 1.5.5 - also, please provide a testpage, otherwise I
 can't help.

 Jörn



 On Tue, Sep 22, 2009 at 11:08 PM, chief7 chi...@gmail.com wrote:

  fyi - using jquery.validate.js version 1.5.2

  On Sep 22, 3:39 pm, chief7 chi...@gmail.com wrote:
  looks like this issue is caused by the name of the input.  the name is
  orders[5].elements[2].Value which an attribute selector won't find
  (ie. $(input[for=orders[5].elements[2].Value])), but if the name is
  elements[2].Value it works fine.

  the 'for' attribute selector is used on line 630 of jquery.validate.js

  On Sep 22, 7:32 am, chief7 chi...@gmail.com wrote:

   the validation error message isn't removed/hidden after i fix an
   invalid input.  If I make the input invalid again another error
   message is appended below the first error message.

   error messages are added/removed appropriately on all other pages.
   this problem is only occurring on one page.- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -


[jQuery] Re: (validation) removal of error message problem

2009-09-22 Thread Jörn Zaefferer

Please update to 1.5.5 - also, please provide a testpage, otherwise I
can't help.

Jörn

On Tue, Sep 22, 2009 at 11:08 PM, chief7 chi...@gmail.com wrote:

 fyi - using jquery.validate.js version 1.5.2

 On Sep 22, 3:39 pm, chief7 chi...@gmail.com wrote:
 looks like this issue is caused by the name of the input.  the name is
 orders[5].elements[2].Value which an attribute selector won't find
 (ie. $(input[for=orders[5].elements[2].Value])), but if the name is
 elements[2].Value it works fine.

 the 'for' attribute selector is used on line 630 of jquery.validate.js

 On Sep 22, 7:32 am, chief7 chi...@gmail.com wrote:



  the validation error message isn't removed/hidden after i fix an
  invalid input.  If I make the input invalid again another error
  message is appended below the first error message.

  error messages are added/removed appropriately on all other pages.
  this problem is only occurring on one page.- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Validation, ignore specific words

2009-09-19 Thread Jörn Zaefferer

You can avoid that issue by using a solution that doesn't modify the
inputs value. The (planned) jQuery UI watermark widget does that, you
can get the code from labs here:
http://jquery-ui.googlecode.com/svn/branches/labs/watermark/ui/ui.watermark.js

A sort-of demo is here: http://www.commadot.com/jquery/experiments/shunra/
More details on the widget here: http://wiki.jqueryui.com/Watermark

Jörn

On Sat, Sep 19, 2009 at 6:44 AM, jbotos m...@jbotos.com wrote:

 Hi, I have values in each input which tells the user what to enter in
 that field. Each value clears on click and resets to default if no
 value is entered. How can I have it treat my values as if it would be
 empty (no value entered)?



[jQuery] Re: [forms] [ajax] Form submits, success message displayed but no data seems to be passed to php file

2009-09-16 Thread Jörn Zaefferer
You don't specify any data to submit in your ajax call. Use the data
option, or better yet, the form's plugin ajaxSubmit method. It will
handle the form serialization for you.

Jörn

On Wed, Sep 16, 2009 at 11:42 AM, HairyJim james.d...@gmail.com wrote:

 Hi all,

 I have this Jquery code, below, which I was hpoing would pass the data
 from the form over to form processing script  but the problem I have
 is that the success is returned but the processing script does not
 seem to get the form data passed to it.

 I have tested the script is called by just firing a success email off.
 What am I doing wrong, I'm lost in the forest and can't see the trees!

 I am including jquery, jquery.validate and jquery.form

 $(document).ready(function()
 {
        $(#myform).validate({
                submitHandler: function() {
                        $.ajax({
                                type: POST,
                                url: thanks.php,
                                success: function() {
                                        $('#contact_form').html(div 
 id='message'/div);
                                        $('#message').html(h2Contact Form 
 Submitted!/h2)
                                  .append(pWe will be in touch soon./p)
                                  .hide()
                                  .fadeIn(1500, function() {
                                          $('#message').append(img 
 id='checkmark' src='/images/
 check.png' /);
                                  });
                                }
                        });
                }
        });
 });


[jQuery] Re: [forms] [ajax] Form submits, success message displayed but no data seems to be passed to php file

2009-09-16 Thread Jörn Zaefferer
Here is an example:
http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html

Jörn

On Wed, Sep 16, 2009 at 12:39 PM, HairyJim james.d...@gmail.com wrote:

 Sorry, I have no idea where to use the .ajaxSubmit() option in the
 code. What do I need to change to pass the data over to the processing
 file?


 Thanks
 James

 On Sep 16, 10:49 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
 You don't specify any data to submit in your ajax call. Use the data
 option, or better yet, the form's plugin ajaxSubmit method. It will
 handle the form serialization for you.

 Jörn

 On Wed, Sep 16, 2009 at 11:42 AM, HairyJim james.d...@gmail.com wrote:

  Hi all,

  I have this Jquery code, below, which I was hpoing would pass the data
  from the form over to form processing script  but the problem I have
  is that the success is returned but the processing script does not
  seem to get the form data passed to it.

  I have tested the script is called by just firing a success email off.
  What am I doing wrong, I'm lost in the forest and can't see the trees!

  I am including jquery, jquery.validate and jquery.form

  $(document).ready(function()
  {
         $(#myform).validate({
                 submitHandler: function() {
                         $.ajax({
                                 type: POST,
                                 url: thanks.php,
                                 success: function() {
                                         $('#contact_form').html(div 
  id='message'/div);
                                         $('#message').html(h2Contact 
  Form Submitted!/h2)
                                   .append(pWe will be in touch 
  soon./p)
                                   .hide()
                                   .fadeIn(1500, function() {
                                           $('#message').append(img 
  id='checkmark' src='/images/
  check.png' /);
                                   });
                                 }
                         });
                 }
         });
  });


[jQuery] Re: [validate] Help with errorPlacement

2009-09-16 Thread Jörn Zaefferer

You need to go up one more level:

errorPlacement: function(error, element){
  error.appendTo( element.parent().parent().next().find(.errorMsg) );
}

Jörn

On Wed, Sep 16, 2009 at 8:18 PM, Loony2nz loony...@gmail.com wrote:

 Hello,

 I need help with targeting a class on a TD to hold error messages with
 jQuery form validator plug-in.

 This is my sampling of code:

  script
 
 errorPlacement: function(error, element){
   error.appendTo( element.parent().next());
 }
 / script

 tr style=border:0;
    td style=border:0; align=rightFirst Namespan
 style=color:#f00;*/span/td
     td style=border:0;input maxlength=40 name=first_name
 size=20 type=text //td
 /tr
 tr style=border:0;
     td style=border:0;/td
     td class=errorMsg style=border:0;/td
 /tr

 I want to target the TD with the class: errorMsg to hold the error
 message.

 I've tried  error.appendTo( element.parent().next('.errorMsg')); to no
 avail.

 Any help would be much appreciated.

 Thanks


[jQuery] Re: [validate] Custom functions onfocusin / -out

2009-09-16 Thread Jörn Zaefferer

You could also just bind focus and blur events to each element for the
same effect, without requiring a change to the plugin code.

Jörn

On Wed, Sep 16, 2009 at 11:32 PM, Philipp philipp.ma...@googlemail.com wrote:

 Hi!

 I added a nice little tweak which allows me to define custom functions
 called on (un) focussing a form element:

 jquery.validate.js got three additional lines at the end of onfocusin
 function (line 200):
                        if (this.settings.focusFunction) {
                                this.settings.focusFunction(element);
                        }
 and at the end of onfocusout function:
                        if (this.settings.blurFunction) {
                                this.settings.blurFunction(element);
                        }

 By defining a focusFunction / blurFunction within a jQuery
 ('#...').validate({})-block I was able to add a custom behaviour to
 those two events without writing additional JavaScript code. In my
 case I simply display or hide a div containing some help for the form
 element.

 Maybe this little code change will help somebody or even find its way
 to the official release.

 Kind regards and thank you for your validator!
  Philipp



[jQuery] Re: Validate: Focus on first invalid field after validation

2009-09-15 Thread Jörn Zaefferer

Whats wrong with keeping the focus on the active field, if its invalid?

If you enter something into the, say, third field, hit enter to
submit, then it turns out both that field and another before that are
invalid, why move the focus to a different field?

Jörn

On Tue, Sep 8, 2009 at 4:47 AM, Geoffrey geoffreydhug...@gmail.com wrote:

 I've been building up my validation using the jquery validation plugin
 but I can't work out how to get a failed validation to default the
 focus to the first invalid input rather than to the last selected
 input.

 If there is no input field selected, when I submit then a failed
 validation will focus the cursor on the first field but if the cursor
 was left in a field and submitted then the focus stays there (if it's
 invalid) rather than jump to the first invalid input.  From what I've
 read and seen, this is the expected behaviour but not what I want.

 Is there a way I can get the first invalid field and set the focus to
 that?

 A demo of what I have built up so far can be seen at
 https://webdev2.otago.ac.nz/oihrn2009/

 All my jquery validation can be found in
 https://webdev2.otago.ac.nz/oihrn2009/javascript/document.ready.all.js




[jQuery] Re: [validate] custom validation messages

2009-09-15 Thread Jörn Zaefferer

You shouldn't use visible-required as the method name. Stick with a
valid JavaScript identifier (probably should have mentioned that).

As long as you do that, you can use addMethod to alias existing
methods with other default messages. On the other hand, addClassRules
doesn't help at all with messages.

Jörn

On Tue, Sep 15, 2009 at 5:32 PM, Dr Stevens daverstev...@gmail.com wrote:

 I'm using the validate plugin to validate ASP.NET webforms on the
 client (I'd prefer to not use webforms, but for now I'm stuck with
 it).  Because I'm using webforms, I'm trying to get around using the
 clientID of server controls.  The metadata plugin works great, but I'd
 prefer to not use it because it's gonna blow up my markup.

 Is there any way to utilize jQuery.validator.addClassRules to add
 custom messages to a rule?  Take the following for instance:

 jQuery.validator.addMethod(visible-required, function(value,
 element) {
    return $(element).is(:hidden) || !this.optional(element);
 }, This is required when visible);

 jQuery.validator.addClassRules(fool, {
    visible-required: true,
    lettersonly: true,
    messages: {
        visible-required: My specific field must is required,
        lettersonly: Letters only fool!
    }
 });

 On a slightly related note, is there any overhead associated with
 adding custom validation methods specific to some field only to
 override the default message?  Take the following:

 jQuery.validator.addMethod(visible-required, function(value,
 element) {
    return $(element).is(:hidden) || !this.optional(element);
 }, This is required when visible);

 jQuery.validator.addMethod(visible-required-fool,
    jQuery.validator.methods.visible - required,
    My specific field is required);

 I saw your talk at the conference last weekend btw.  Thanks



[jQuery] Re: [validate] custom validation messages

2009-09-15 Thread Jörn Zaefferer

I actually changed the plugin page to ask for (validate). When you
use Google Groups in an email client, the subject is displayed just
fined, while the Web interface removes the prefix.

Jörn

On Tue, Sep 15, 2009 at 6:40 PM, Dr Stevens daverstev...@gmail.com wrote:

 Sorry for the spam, fixing the subject

 On Sep 15, 12:39 pm, Dr Stevens daverstev...@gmail.com wrote:
 Thanks for your help.  You always seem to be very quick to respond and
 I, along with everyone else I'm sure, am very appreciative.

 Great plugin!

 On Sep 15, 12:35 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:

  You shouldn't use visible-required as the method name. Stick with a
  valid JavaScript identifier (probably should have mentioned that).

  As long as you do that, you can use addMethod to alias existing
  methods with other default messages. On the other hand, addClassRules
  doesn't help at all with messages.

  Jörn

  On Tue, Sep 15, 2009 at 5:32 PM, Dr Stevens daverstev...@gmail.com wrote:

   I'm using the validate plugin to validate ASP.NET webforms on the
   client (I'd prefer to not use webforms, but for now I'm stuck with
   it).  Because I'm using webforms, I'm trying to get around using the
   clientID of server controls.  The metadata plugin works great, but I'd
   prefer to not use it because it's gonna blow up my markup.

   Is there any way to utilize jQuery.validator.addClassRules to add
   custom messages to a rule?  Take the following for instance:

   jQuery.validator.addMethod(visible-required, function(value,
   element) {
      return $(element).is(:hidden) || !this.optional(element);
   }, This is required when visible);

   jQuery.validator.addClassRules(fool, {
      visible-required: true,
      lettersonly: true,
      messages: {
          visible-required: My specific field must is required,
          lettersonly: Letters only fool!
      }
   });

   On a slightly related note, is there any overhead associated with
   adding custom validation methods specific to some field only to
   override the default message?  Take the following:

   jQuery.validator.addMethod(visible-required, function(value,
   element) {
      return $(element).is(:hidden) || !this.optional(element);
   }, This is required when visible);

   jQuery.validator.addMethod(visible-required-fool,
      jQuery.validator.methods.visible - required,
      My specific field is required);

   I saw your talk at the conference last weekend btw.  Thanks


[jQuery] Re: [validate] custom validation messages

2009-09-15 Thread Jörn Zaefferer

Ah, thanks for the hint, forgot to update that comment. Fixed it now!

Jörn

On Tue, Sep 15, 2009 at 6:52 PM, Dr Stevens daverstev...@gmail.com wrote:

 gotcha, figured that out after my last post.

 I actually got here from your last comment on http://bassistance.de/
 jquery-plugins/jquery-plugin-validation/.  I will make note to use
 (validate) instead.

 On Sep 15, 12:47 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
 I actually changed the plugin page to ask for (validate). When you
 use Google Groups in an email client, the subject is displayed just
 fined, while the Web interface removes the prefix.

 Jörn

 On Tue, Sep 15, 2009 at 6:40 PM, Dr Stevens daverstev...@gmail.com wrote:

  Sorry for the spam, fixing the subject

  On Sep 15, 12:39 pm, Dr Stevens daverstev...@gmail.com wrote:
  Thanks for your help.  You always seem to be very quick to respond and
  I, along with everyone else I'm sure, am very appreciative.

  Great plugin!

  On Sep 15, 12:35 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:

   You shouldn't use visible-required as the method name. Stick with a
   valid JavaScript identifier (probably should have mentioned that).

   As long as you do that, you can use addMethod to alias existing
   methods with other default messages. On the other hand, addClassRules
   doesn't help at all with messages.

   Jörn

   On Tue, Sep 15, 2009 at 5:32 PM, Dr Stevens daverstev...@gmail.com 
   wrote:

I'm using the validate plugin to validate ASP.NET webforms on the
client (I'd prefer to not use webforms, but for now I'm stuck with
it).  Because I'm using webforms, I'm trying to get around using the
clientID of server controls.  The metadata plugin works great, but I'd
prefer to not use it because it's gonna blow up my markup.

Is there any way to utilize jQuery.validator.addClassRules to add
custom messages to a rule?  Take the following for instance:

jQuery.validator.addMethod(visible-required, function(value,
element) {
   return $(element).is(:hidden) || !this.optional(element);
}, This is required when visible);

jQuery.validator.addClassRules(fool, {
   visible-required: true,
   lettersonly: true,
   messages: {
       visible-required: My specific field must is required,
       lettersonly: Letters only fool!
   }
});

On a slightly related note, is there any overhead associated with
adding custom validation methods specific to some field only to
override the default message?  Take the following:

jQuery.validator.addMethod(visible-required, function(value,
element) {
   return $(element).is(:hidden) || !this.optional(element);
}, This is required when visible);

jQuery.validator.addMethod(visible-required-fool,
   jQuery.validator.methods.visible - required,
   My specific field is required);

I saw your talk at the conference last weekend btw.  Thanks


[jQuery] Re: Validate: Focus on first invalid field after validation

2009-09-15 Thread Jörn Zaefferer

Well, you can set focusInvalid: false and implement invalidHandler to
focus the first field. That should do the trick.

Jörn

On Tue, Sep 15, 2009 at 10:01 PM, Geoffrey geoffreydhug...@gmail.com wrote:

 And what if you enter an invalid character in an input at the bottom
 of the field? For example entering a letter in the Conference Dinner
 input of my sample form.

 A user is going to miss the error message at the top of the form along
 with other input errors if there's an error in the last inputs of my
 example form and is going to have submit multiple times before they
 may even be aware of other errors.

 I'd expected jumping to the first invalid input to be standard
 behaviour.  My fault there I guess.




 On Sep 15, 10:08 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
 Whats wrong with keeping the focus on the active field, if its invalid?

 If you enter something into the, say, third field, hit enter to
 submit, then it turns out both that field and another before that are
 invalid, why move the focus to a different field?

 Jörn



 On Tue, Sep 8, 2009 at 4:47 AM, Geoffrey geoffreydhug...@gmail.com wrote:

  I've been building up my validation using the jquery validation plugin
  but I can't work out how to get a failed validation to default the
  focus to the first invalid input rather than to the last selected
  input.

  If there is no input field selected, when I submit then a failed
  validation will focus the cursor on the first field but if the cursor
  was left in a field and submitted then the focus stays there (if it's
  invalid) rather than jump to the first invalid input.  From what I've
  read and seen, this is the expected behaviour but not what I want.

  Is there a way I can get the first invalid field and set the focus to
  that?

  A demo of what I have built up so far can be seen at
 https://webdev2.otago.ac.nz/oihrn2009/

  All my jquery validation can be found in
 https://webdev2.otago.ac.nz/oihrn2009/javascript/document.ready.all.js


[jQuery] Re: Validate: Focus on first invalid field after validation

2009-09-15 Thread Jörn Zaefferer

Something like this?

$(form).validate({
  focusInvalid: false,
  invalidHandler: function() {
$(this).find(:input.error:first).focus();
  }
});

Jörn

On Tue, Sep 15, 2009 at 10:24 PM, Geoffrey geoffreydhug...@gmail.com wrote:

 I guess I'm going to have too.  I just need to work out how to return
 the first invalid field so I can set the focus.



 On Sep 16, 8:16 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
 Well, you can set focusInvalid: false and implement invalidHandler to
 focus the first field. That should do the trick.

 Jörn



 On Tue, Sep 15, 2009 at 10:01 PM, Geoffrey geoffreydhug...@gmail.com wrote:

  And what if you enter an invalid character in an input at the bottom
  of the field? For example entering a letter in the Conference Dinner
  input of my sample form.

  A user is going to miss the error message at the top of the form along
  with other input errors if there's an error in the last inputs of my
  example form and is going to have submit multiple times before they
  may even be aware of other errors.

  I'd expected jumping to the first invalid input to be standard
  behaviour.  My fault there I guess.

  On Sep 15, 10:08 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:
  Whats wrong with keeping the focus on the active field, if its invalid?

  If you enter something into the, say, third field, hit enter to
  submit, then it turns out both that field and another before that are
  invalid, why move the focus to a different field?

  Jörn

  On Tue, Sep 8, 2009 at 4:47 AM, Geoffrey geoffreydhug...@gmail.com 
  wrote:

   I've been building up my validation using the jquery validation plugin
   but I can't work out how to get a failed validation to default the
   focus to the first invalid input rather than to the last selected
   input.

   If there is no input field selected, when I submit then a failed
   validation will focus the cursor on the first field but if the cursor
   was left in a field and submitted then the focus stays there (if it's
   invalid) rather than jump to the first invalid input.  From what I've
   read and seen, this is the expected behaviour but not what I want.

   Is there a way I can get the first invalid field and set the focus to
   that?

   A demo of what I have built up so far can be seen at
  https://webdev2.otago.ac.nz/oihrn2009/

   All my jquery validation can be found in
  https://webdev2.otago.ac.nz/oihrn2009/javascript/document.ready.all.js


[jQuery] Re: (validate) email validator

2009-09-15 Thread Jörn Zaefferer

Yep. The goal here is to indicate to the user that he mistyped his
address. For that to work reliably, the validation must accept all
valid addresses, not just those that feel more valid then others.

Jörn

On Tue, Sep 15, 2009 at 10:39 PM, Scott Haneda talkli...@newgeo.com wrote:

 Right, this is sort of a long debate, which I see pop up on mailing lists
 for email servers.  In the end, I think you need to go by the standards.

 Just because hotmail breaks the rules, does not mean you want to punish some
 other user who does not use hotmail, just because they use a character in
 their email address that hotmail does not.

 On Sep 14, 2009, at 6:04 PM, Sean McKenna wrote:

 While technically this is correct, a more restrictive approach might
 be preferable because some email services (hotmail for one) will not
 send to an email address using anything other than alphanumerics,
 dots, hyphens, and underscores.

 --
 Scott * If you contact me off list replace talklists@ with scott@ *




[jQuery] Re: Validate: Focus on first invalid field after validation

2009-09-15 Thread Jörn Zaefferer

I can't reproduce that. Seems to work fine for me.

Jörn

On Tue, Sep 15, 2009 at 11:40 PM, Geoffrey geoffreydhug...@gmail.com wrote:

 Hmmm...I tried this but I discovered on the first submit that it
 doesn't focus the first invalid field but it will if I hit return to
 submit again.

 Also, when hitting submit on a field that's not checked for validity,
 the form will submit successfully this second time as well despite
 still having invalid fields.

 You can test it out using my sample form from the OP.


 On Sep 16, 8:37 am, Geoffrey geoffreydhug...@gmail.com wrote:
 Damn.  I always forget about :first.

 Thanks.

 On Sep 16, 8:34 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:



  Something like this?

  $(form).validate({
    focusInvalid: false,
    invalidHandler: function() {
      $(this).find(:input.error:first).focus();
    }

  });

  Jörn

  On Tue, Sep 15, 2009 at 10:24 PM, Geoffrey geoffreydhug...@gmail.com 
  wrote:

   I guess I'm going to have too.  I just need to work out how to return
   the first invalid field so I can set the focus.

   On Sep 16, 8:16 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
   wrote:
   Well, you can set focusInvalid: false and implement invalidHandler to
   focus the first field. That should do the trick.

   Jörn

   On Tue, Sep 15, 2009 at 10:01 PM, Geoffrey geoffreydhug...@gmail.com 
   wrote:

And what if you enter an invalid character in an input at the bottom
of the field? For example entering a letter in the Conference Dinner
input of my sample form.

A user is going to miss the error message at the top of the form along
with other input errors if there's an error in the last inputs of my
example form and is going to have submit multiple times before they
may even be aware of other errors.

I'd expected jumping to the first invalid input to be standard
behaviour.  My fault there I guess.

On Sep 15, 10:08 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
Whats wrong with keeping the focus on the active field, if its 
invalid?

If you enter something into the, say, third field, hit enter to
submit, then it turns out both that field and another before that are
invalid, why move the focus to a different field?

Jörn

On Tue, Sep 8, 2009 at 4:47 AM, Geoffrey geoffreydhug...@gmail.com 
wrote:

 I've been building up my validation using the jquery validation 
 plugin
 but I can't work out how to get a failed validation to default the
 focus to the first invalid input rather than to the last selected
 input.

 If there is no input field selected, when I submit then a failed
 validation will focus the cursor on the first field but if the 
 cursor
 was left in a field and submitted then the focus stays there (if 
 it's
 invalid) rather than jump to the first invalid input.  From what 
 I've
 read and seen, this is the expected behaviour but not what I want.

 Is there a way I can get the first invalid field and set the focus 
 to
 that?

 A demo of what I have built up so far can be seen at
https://webdev2.otago.ac.nz/oihrn2009/

 All my jquery validation can be found in
https://webdev2.otago.ac.nz/oihrn2009/javascript/document.ready.all.js


[jQuery] Re: (validate), submitHandler and custom function

2009-09-13 Thread Jörn Zaefferer

Try this:

submitHandler: function(form) {
  $.post(form.action, $(this).serialize(), null, script);
}

Jörn

On Sun, Sep 13, 2009 at 12:42 AM, bgumbiker bogumil.bial...@gmail.com wrote:

 Hello,
 I am looking for a way to call successfully custom function from
 submitHandler to do proper ajax post.

 Here is my custom function:

 jQuery.fn.submitWithAjax = function() {
  this.submit(function() {
    $.post(this.action, $(this).serialize(), null, script);
    return false;
  })
  return this;
 };

 Before using validate plugin I had following which worked fine:

 $(document).ready(function() {
   $(#my_form).submitWithAjax();
  }

 Now I have added the validation part and have no idea how to call my
 custom submitWithAjax function??

 $(document).ready(function() {

    $(#my_form).validate({

                /*Validations - works perfectly!! */

             },

             submitHandler: function(form) {

             /* $(#my_form).submitWithAjax(); - this works but
 introduces recursion */

             /* how to call custom subitWithAjax() ? */

             }

        });
 })


 Thanks!







[jQuery] Re: (validate) dash/hyphen in radio id problem

2009-09-11 Thread Jörn Zaefferer

See 
http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_complex_names_.28brackets.2C_dots.29

Jörn

On Fri, Sep 11, 2009 at 2:26 PM, mattso matthieu.larc...@gmail.com wrote:

 Hi,

 I'm using the bassistance.de Validation Plugin for jQuery and I have
 the following problem :

 When using a dash(-) separated id for genres (i.e. genre-f / genre-m),
 I get the following js error : missing : after property id with the
 following code:
 rules: {
        genre-f: {
                required: #genre-m
        },
        genre-m: {
                required: function() {
                        return $(#genre-f).is(:checked);
                }
        },
 It seems that the js (json?) doesn't allow the use of a - inside a
 variable name.

 Unfortunately, I can't change the id names, as they are being
 generated by Zend Framework which doesn't allow to replace it with
 another character.

 Anybody would know a way around this ?

 It seems to me that in the case of multi-options inputs, the script
 should focus on the name instead of the id...
 Any clue would be appreciated.



[jQuery] Re: [jQuery Validate]Validating for incremental form

2009-09-11 Thread Jörn Zaefferer

Something like this? http://jquery.bassistance.de/validate/demo/multipart/

Jörn

On Fri, Sep 11, 2009 at 4:04 AM, gMinuses gminu...@gmail.com wrote:

 I have the form:

 form
    div id=portion1
        ... some inputs ...
    /div
    div id=portion2
        ... some inputs ...
    /div
    div id=portion3
        ... some inputs ...
    /div
 /form

 By default, only #portion1 is visible. If inputs inside it are all
 valid, #portion2 will be visible and #portion1 will be hidden, and so
 on.

 The problem is that jQuery Validate will only validate the whole form,
 so something like $('#portion1').validate().form() won't work.

 So, is there a way to achieve this?
 Thanks.



[jQuery] Re: Use the validation outside the form.

2009-09-07 Thread Jörn Zaefferer

Nope, you really need a form. Whats the problem with just using a form
element, at least nested within your div?

Jörn

On Mon, Sep 7, 2009 at 10:28 AM, Jozef A. Habdankjahabd...@gmail.com wrote:

 Hello Everybody,

 this is my first post here - please forgive me any stupid questions.

 My idea is to have a fully AJAX based form that will validate the
 input, then via AJAX post it, and accordingly to the AJAX response
 display some messages (no full postback). I have no problem with the
 AJAX itself, the only issue I face is that my 'form' is not actually a
 form - it is a simple div with some textboxes (I am using Asp, and
 using forms is not so easy here, sine you can not have nested forms).
 Unfortunately the jQuery validation (http://docs.jquery.com/Plugins/
 Validation) does not work for div. Is there any way to use jQuery
 validation without having to use form tag?

 Best regards,
 Jozef A. Habdank

 ps. awesome work done jQuery :)



[jQuery] Re: [validate] plugin: combine features from multiple demos

2009-09-03 Thread Jörn Zaefferer

Take a closer look at the multipart demo and its custom
pageRequired-method - thats key!

Jörn

On Wed, Sep 2, 2009 at 11:24 PM, seezeedebbil...@gmail.com wrote:

 i posted this to the plugin group, but it appears to be a dead forum
 -- last post was february. i'm trying to combine features of these 2
 demos:

 http://jquery.bassistance.de/validate/demo/milk/
 http://jquery.bassistance.de/validate/demo/multipart/

 specifically, i want the ability to use custom error messages and to
 declare conditions in the page head, as in the 1st demo, as well as to
 use the accordion feature of the 2nd. if i use the code from the milk
 demo in the head, e.g.,

 $(document).ready(function() {
        // validate signup form on keyup and submit
        var validator = $(#signupform).validate({
                rules: {
                        [rules]
                },
                messages: {
                        [messages]
                },
        });
 }

 validation runs on the entire form, including the sections not yet
 made visible. this prevents the 'next' button from operating, so the
 accordion won't expand. if i assign a unique id to the each fieldset 
 run separate validations for each fieldset, the accordion works, but
 the validation stops working. i'm pretty lousy at javascript, so i
 could sure use some help. has anyone else out there successfully tried
 this?



[jQuery] Re: (validate) Is it possible to explicitly call a registered rule

2009-09-03 Thread Jörn Zaefferer

Sure. Something like this:

$.validator.addMethod(custom, function() {
  var validEmail = $.validator.methods.email.apply(this, arguments);
  return validEmail  someOtherCheck();
});

Jörn

On Thu, Sep 3, 2009 at 6:37 PM, TheChrisPrattthechrispr...@gmail.com wrote:

 I have a case where I want to create a validator that makes use of
 already defined rules.  Is it possible to somehow call pseudocode
 $.validator.rules.ruleA('value',element,null)/pseudocode?? Thanks.
  (*Chris*)


[jQuery] Re: Clickable autocomplete, like google

2009-09-02 Thread Jörn Zaefferer

Based on http://plugins.jquery.com/project/autocompletex

$(#search).autocomplete(/searchAutocomplete, {
dataType: json,
parse: function(data) {
return $.map(data, function(row) {
return {
data: row,
value: row.text
}
});
},
formatItem: function(item) {
return item.text;
},
minChars: 1,
selectFirst: false
}).result(function(event, data) {
location.href = data.url;
});

The JSON response looks like this:

[{text:google,url:http://google.com}, {text: other, url:
whatever}]

Jörn

On Tue, Sep 1, 2009 at 11:57 PM, ladksakslingrs...@gmail.com wrote:

 Hello

 I'm looking for an autocomplete that have no submit button, but that
 when the user click on the autocomplete keyword he would be redirected
 to another URL, that i will choose

 i'm using http://dyve.net/jquery/?autocomplete but even the author
 dont know how to make this

 example:

 user type goo
 then appears GOOGLE for him, when he click on GOOGLE the script send
 him to www.google.com

 it would be great if i could just do with the script i told you guys
 i'm not a programmer so i need like, the code itself, i know its too
 much to ask but i tried everything =\

 thank you!



[jQuery] Re: jQuery accordion menus flickering in IE 6 and 7

2009-09-01 Thread Jörn Zaefferer

This should be fixed in trunk. Give the latest stylesheet a try:
http://jquery-ui.googlecode.com/svn/trunk/themes/base/ui.accordion.css

Jörn

On Mon, Aug 31, 2009 at 8:54 PM, Moose1rcob...@gmail.com wrote:

 I've seen several threads about this online but haven't not seen a
 solution that has worked so far. My accordions work great, but in IE 6
 or 7, when the animation is done, the entire contents of that div
 flicker for a split second. Is there a solution to this?

 My page is here: http://www.keene.edu/grants/internal_test1.cfm

 Thanks so much for any help on this.



[jQuery] Re: [validate] [ajax]

2009-09-01 Thread Jörn Zaefferer

You need to use ajaxSubmit and the submitHandler option. Here is an
example: 
http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html

Jörn

On Tue, Sep 1, 2009 at 12:25 PM, HairyJimjames.d...@gmail.com wrote:

 Hi all,

 Still green with JQ. I have the following code which does work to a
 point except the validation runs but the form submits (via ajax)
 regardless. I know I need to change the code round, ajax in the the
 validate call - I think. Could do with help on this!

 $(document).ready(function()
 {
        $(#myform).validate();
        $(#myform).ajaxForm({
                success: function() {
                        $('#contact_form').html(div id='message'/div);
                        $('#message').html(h2Contact Form Submitted!/h2)
              .append(pWe will be in touch soon./p)
              .hide()
              .fadeIn(1500, function() {
                          $('#message').append(img id='checkmark' 
 src='/images/
 check.png' /);
                  });
                }
        });
 });



[jQuery] Re: jQuery Validation Submitting without Validation in Firefox (validate)

2009-09-01 Thread Jörn Zaefferer

You've got a script error on submit. Set debug:true to stop the submit
and look at the error.

Jörn

On Tue, Sep 1, 2009 at 3:45 PM,
jake.d.hol...@googlemail.comjake.d.hol...@googlemail.com wrote:

 Hi Guys,

 I've put together a pretty simple competition script - it's commented
 out below and you can find the demo at 
 http://www.jakeisonline.com/stackoverflow/jqueryvalidation/page/
 (you'll find the code at the bottom of the page)

 I am using a jquery plugin to achieve the validation:
 http://bassistance.de/jquery-plugins/jquery-plugin-validation/

 The problem is only in Firefox (3.5.2) - the form submits without any
 validation at all, and ignores the ajax. IE8  7 seem to be fine.

 I'm not really sure why Firefox is submitting the page with Refresh
 but IE isn't, I've looked over and over the code and can't find the
 error. Firebug is only finding errors in the jQuery library itself.

 Can anyone help?



[jQuery] Re: (Validation) How to use with Multi-Select?

2009-08-27 Thread Jörn Zaefferer

Here are examples with multi-selects:
http://jquery.bassistance.de/validate/demo/radio-checkbox-select-demo.html

Jörn

On Thu, Aug 27, 2009 at 3:04 PM, Psyclom...@datamodel.org wrote:

 I have a form with a multi-select field that needs to be validated, so
 at least one option is selected.  Is there a setting I'm missing in
 the validation plug-in?

 Thanks in advance.



[jQuery] Re: validate classbased via ajax request

2009-08-26 Thread Jörn Zaefferer

Writing a custom remote method is currently not supported. You'd have
to copy the existing remote method. Instead, try to put the local
custom validation into its own method, and use the remote method in
addition, for the same field:
http://docs.jquery.com/Plugins/Validation/Methods/remote

Jörn

On Wed, Aug 26, 2009 at 2:38 AM, Jan Limpensjan.limp...@gmail.com wrote:
 Hello,

 my forms are all css class based validated. Now I need to check some on them
 serverside, so I overload the regular validation methods (or is there a
 better way?).

     jQuery.validator.addMethod(date, function(value, element) {
     var preValid = this.optional(element) ||
 /^\d\d?\/\d\d?\/\d\d\d?\d?$/.test(value);
     if (!preValid)
     return false;
     $.getJSON(urlDefs.validateDate + ?date= + value, function(data) {
     var result = data.Data;
     // what can I do with this result?
     // how can I set element valid?
     });
     }, jQuery.validator.messages['date']);

 I might be doing something wrong...
 I know there is a remote({}) method, but how could I use it from there? It
 might work less asynchronously, thus easier...
 --
 Jan



[jQuery] Re: [autocomplete]

2009-08-25 Thread Jörn Zaefferer

What is a virtual keyboard?

Jörn

On Tue, Aug 25, 2009 at 2:43 PM, Mahmoud
wagdyeng.mahmoud.wa...@gmail.com wrote:

 we need to add a virtual keyboard to the same textbox which uses yours
 autocomplete plugin.
 is this applicable with your autocomplete plugin



[jQuery] Re: [treeview] Can I apply classes to async trees??

2009-08-24 Thread Jörn Zaefferer

You can use the classes property in the JSON response. These are
added to each node.

Jörn

On Mon, Aug 24, 2009 at 12:12 PM, nsbkpedro...@gmail.com wrote:

 Hi!

 I'm currently working on a project in wich I use a pair of trees. The
 thing is that one of them is too big and IE6 (it needs to be
 supported :s ) takes forever to process the tree so I want to load it
 asynchronously branch by branch using the async version of the tree.

 The problem is that I want the tree to be a filetree, but when created
 as async it displays with default style. Is it possible to create an
 async filetree (without applying the classes manually)??

 Here's my code:

 //js
        $(document).ready(function(){
                $(#tree).treeview({
                        url: MenuTree.aspx,animated: fast,collapsed: true, 
 unique: true
                })
        });
 //html

        ul id=tree class=filetree
        /ul

 Thanks in advance!

 -- nsbk



[jQuery] Re: [validate] Radios with empty values and required:true

2009-08-24 Thread Jörn Zaefferer

When a question isn't required, it shouldn't have the required-rule.

Jörn

On Mon, Aug 24, 2009 at 1:43 PM, Gordongrj.mc...@googlemail.com wrote:

 I'm working on a survey builder that lets people generate web forms
 for collecting user data.  Form builders can create forms with various
 controls on them.

 At the moment I'm building in a jQuery validate layer (there is also a
 server side validation layer, but I want to keep users from making
 unnecessary submits).  I've run into a little problem with radio
 buttons though.

 If I have radio buttons that all have values (input type=radio
 name=radioQuestion value=1, input type=radio
 name=radioQuestion value=2, etc) then if I set up a required:true
 rule and try to submit I get a validation error as expected.  However,
 if there's a radio with no value in the group, such as input
 type=radio name=radioQuestion value= then if the radio with no
 value is selected, the validation check is passed.

 Is there a way around this, other than simply not including a radio
 button with no value?  I'd want this for questions that aren't set
 required.


[jQuery] Re: [validate] problem of defining custom rules

2009-08-24 Thread Jörn Zaefferer
firstname must refer to the name of a field. There is no field with
that name in your form, just class=firstname.

Jörn

On Mon, Aug 24, 2009 at 4:55 PM, davidmichaelg...@gmail.com wrote:

 i played with the example.html from jquery.validate 1.55 and wanted to
 make a custom rule firstname that is required, with the message please
 enter a firstname.
 My changes were in the validate :
 $(#commentForm).validate({
                rules: {
                        firstname: required
                        },
                messages: {
                        firstname: Enter your firstname
                }
        });

 and then        input id=cname name=name class=firstname
 minlength=2 /
 my problem is that it is shown as valid, even i don't enter nothing.
 i don't know what i am making wrong

 Thanks,
 David

 This is the code
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
 www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 meta http-equiv=Content-Type content=text/html;
 charset=ISO-8859-1 /
 titlejQuery validation plug-in - comment form example/title

 link rel=stylesheet type=text/css media=screen href=css/
 screen.css /

 script src=../lib/jquery.js type=text/javascript/script
 script src=../jquery.validate.js type=text/javascript/script

 !-- for styling the form --
 script src=js/cmxforms.js type=text/javascript/script

 script type=text/javascript
 $(document).ready(function() {
        $(#commentForm).validate({
                rules: {
                        firstname: required
                        },
                messages: {
                        firstname: Enter your firstname
                }
        });
 });
 /script

 style type=text/css
 #commentForm { width: 500px; }
 #commentForm label { width: 250px; }
 #commentForm label.error, #commentForm input.submit { margin-left:
 253px; }
 /style

 /head
 body

 form class=cmxform id=commentForm method=post action=
        fieldset
                legendPlease provide your name, email address (won't be 
 published)
 and a comment/legend
                p
                        label for=cnameName (required, at least 2 
 characters)/label
                        input id=cname name=name class=firstname 
 minlength=2 /
                p
                        label for=cemailE-Mail (required)/label
                        input id=cemail name=email class=required email 
 /
                /p
                p
                        label for=curlURL (optional)/label
                        input id=curl name=url class=url value= /
                /p
                p
                        label for=ccommentYour comment (required)/label
                        textarea id=ccomment name=comment 
 class=required/textarea
                /p
                p
                        input class=submit type=submit value=Submit/
                /p
        /fieldset
 /form

 /body
 /html


[jQuery] Re: Cursor moves to start position in Opera Autocomplete Plugin

2009-08-22 Thread Jörn Zaefferer

Just released version 1.1, which fixes this issue:
http://plugins.jquery.com/node/9879

Jörn

On Thu, Aug 20, 2009 at 9:29 PM, juanefrenjuanef...@gmail.com wrote:

 With the autocomplete plugin and using Opera; When the input value, is
 not found in the suggestions the cursor moves to the beginning of the
 text, does any body knows how to solve it ?

 Thanks in advance



[jQuery] Re: [validate] - how to validate tinymce editor?

2009-08-21 Thread Jörn Zaefferer

Check this out: http://jquery.bassistance.de/validate/demo/tinymce/

Jörn

On Fri, Aug 21, 2009 at 5:49 PM, D Adali...@gmail.com wrote:

 Is it possible to inject somewhere inside validate() some action
 before it is validatede.g. copy all content first to textarea.

 Tomas:

 I believe you have to attach the onClick event to the form submit
 button for TinyMCE to move the content into the textArea.

 I think you could probably just remove that event and call that event
 via jQeuery after you validate.

 $(#submit).click(function(){
       // put your TinyMCE moveContentToTextArea function here
       // validate the text area
       // if valid, submit else cancel
 }):;

 -Darrel



[jQuery] Re: setData and extraParams problem

2009-08-20 Thread Jörn Zaefferer

What exact version of the autocomplete plugin are you using?

Have you tried autocomplete(option, extraParams, ...) instead of setData?

Jörn

On Sat, Aug 8, 2009 at 6:19 PM, pankajpankaj1...@gmail.com wrote:

 Actually this part was working previously.I found one difference here,
 maybe that help us to find out the actual root cause. Please let me
 know if any of you are aware of this issue.

 Here is OLD and NEW difference of calling auto-completion.
 =
 OLD:
  // Pass along field dependency values to filter auto-completion
 list.
  $textbox.focus(function() {
    var fieldname = this.id;
    $(this).flushCache();
    params = { fname:fieldname };
    $(this).setOptions({ extraParams:add_deps(autocomplete_drilldowns,
                         fieldname, params) });
  });
 
 NEW:
  // Pass along field dependency values to filter auto-completion
 list.
  $textbox.focus(function() {
    var fieldname = this.id.replace(/([{}])/g, '\\$1');
    $(this).autocomplete('flushCache');
    params = { fname:fieldname };
    $(this).autocomplete('setData',
                         { extraParams:add_deps
 (autocomplete_drilldowns,
                           fieldname, params) });
  });
 ===

 Is this causing any issue?

 Thanks


 On Aug 8, 2:19 pm, pankaj pankaj1...@gmail.com wrote:
 Hi All,

 When I do focus is on the autocompletion textbox, that triggers the
 function right below where the autocompletion plugin is initialized ,
 which is supposed to add the key=value values to form the remote
 url. Based on this remote url I am getting the filtered output, which
 will list out in the  autocompletion textbox but its not adding
 key=value. So I am getting all the list. I think  the setData is
 not setting the extraParams.
 help?

 For example:
 If i select one field in the Html form say product xyz and based on
 this the release field should 3 values 1.1 | 1.2 | 1.3, but it
 displays all the list (almost 300 values). Its because when i select
 something in the autocompletion textbox then the url format should be
 something like this:

 http://mdx.lt.com/xyz/abc/ac-list?q=1.limit=300timestamp=1249677100...{1}product=mmm

 Instead of the above it is formating as. Here product field is
 missing, due to which it displays all the release value.

 http://mdx.lt.com/xyz/abc/ac-list?q=1.limit=300timestamp=1249677100...{1}.

 This is my autocomplete call:

     $field.autocomplete({
       url:ac_url,
       cacheLength:1,
       matchContains:true,
       max:300,
       width:'50%',
       scrollHeight:320,
       minChars:1,
       extraParams:{ fname:fieldname },
       formatItem: function(data, i, max, value, term) {
         // data will be an array of value, description
         return 'span class=ui-autocomplete-value' + value +
           '/spanspan class=ui-autocomplete-info' + data[1] + '/
 span';
       }
     });
     $field.autocomplete('result', function() {
       $field.change(); // Notify mass edit that the field's value has
 changed.
       $field.blur(); // Trigger auto-set.
     });
   });

   // Pass along field dependency values to filter auto-completion
 list.
   $textbox.focus(function() {
     var fieldname = this.id.replace(/([{}])/g, '\\$1');
     $(this).autocomplete('flushCache');
     params = { fname:fieldname };
     $(this).autocomplete('setData',
                          { extraParams:add_deps
 (autocomplete_drilldowns,
                            fieldname, params) });
   });

 What is the right way to see what the above function (add_deps) is
 returning?

 Any help will be greatly appreciated.

 Thanks,


[jQuery] Re: [autocomplete] how to clear hidden key field when user changes text value?

2009-08-20 Thread Jörn Zaefferer

You could try this, similar to what the plugin does for the mustMatch option:

$(.autocomplete).blur(function() {
 $(this).search(function(result) {
   if (!result) {
 // no match found, do something, eg. clearing other fields
   }
 });
});

Jörn

On Thu, Aug 13, 2009 at 5:25 PM, Billybilly.swee...@gmail.com wrote:

 Hi all,
 I'm using autocomplete plugin, when the user types something the
 backend responds value and key information (for instance:

 John|76178
 Mike|87252
 Peter|87511


 Using .result I'm setting the key in a hidden field in my form.

 $('#autocompleteTextboxId').result(function(event, data, formatted) {
        if (data)
                $('#autocompleteHiddenValueId').val(data[1]);
 });

 But what if the user changes his mind and after choosing John types
 something else in the textbox (without actually chosing a new option
 from the autocomplete options) or even deletes the whole text? As
 things are now, the data previously set in the hidden field remains
 there. So the user might post the form thinking that his selection is
 blank, but the system actually thinks that he selected 76178.

 Is there a way to clear the hidden field when the user types
 something?

 I tried by setting some action to focus so that whenever the user
 focuses on the textbox the hidden value is cleared but it seems that
 after the user chooses a value in the autocomplete options, the plugin
 sets focus to the text field (hence making this action execute, thus
 clearing the hidden value everytime).

 $('#autocompleteTextboxId').focus(function() {
        $('#autocompleteHiddenValueId').val('');
 });

 It would be cool if we had something like .textChanged (similar to
 .result above) where we can do some action when the user changes the
 text on the field.

 Maybe some of the JS wizards here can suggest something.

 Thanks.



[jQuery] Re: [autocomplete] trigger event if user rejects all autocomplete otions

2009-08-20 Thread Jörn Zaefferer

You could try this, similar to what the plugin does for the mustMatch option:

$(.autocomplete).blur(function() {
  $(this).search(function(result) {
if (!result) {
  // no match found, do something, eg. clearing other fields
}
  });
});

Jörn

On Tue, Aug 11, 2009 at 8:30 PM, Ashash.sea...@gmail.com wrote:

 Does anyone have a library or patch to call a handler if a user leaves
 an autocomplete field without choosing one of the autocomplete options
 - i.e. they've entered free text.

 I'm working with an app that populates multiple fields from a single
 auto-complete value, and our latest requirement is to clear out a
 bunch of fields if the user's entered something manually - rejecting
 autocomplete suggestions.

 My initial attempts at hooking into onkeyfoo and onblur haven't lead
 anywhere productive, and I'm hoping someone else has managed to
 overcome the gnarly event and timing dependencies involved with
 onkeyfoo and blur being used for standard autocomplete behaviour.

 Note: I'm working with http://plugins.jquery.com/project/autocompletex
 - but I'm happy to switch libraries and/or port functionality and
 patches over from another solution.



[jQuery] Re: [validate] - resetForm not working.

2009-08-19 Thread Jörn Zaefferer

Then your code isn't the same. Go back to the example and look at
where the validator-variable is defined.

If that doesn't work out, post a testpage, or at least your full code.

Jörn

On Wed, Aug 19, 2009 at 11:51 AM, Tokasatoka...@gmail.com wrote:

 Hi,
 anybody have experience with this validation plugin?
 http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html

 I need to know how to specify corectly the resetForm() function.

 Simply I need to have submit button to continue (which validates
 before) AND I need to have second submit button which which will go
 step back in my wizard and WILL NOT validate.

 on the link above, in that example it works nicely...but in my
 settings does not.. I have also tried their jquery library etc... but
 did not helped.

 My code is ...the same as in link above..

 $(#PreviousBtn).click(function() {
   validator.resetForm();
 });

 but firebugs tells me...
 validator is not defined
 validator.resetForm(); \n


 Thanks
 Tomas



[jQuery] Re: [validate] - resetForm not working.

2009-08-19 Thread Jörn Zaefferer

As Anoop mentioned: Put a class=cancel on the back button.

Jörn

On Wed, Aug 19, 2009 at 3:18 PM, Tokasatoka...@gmail.com wrote:

 ...forgot to explain details...

 there are two submit buttons ... back and continue

 back button should not validate, just submits back (it is part of a
 wizard)

 continue button should validate and submit.

 
 if you click on back button in FF with firebug you get field validated
 and an error mentioned above.



 On Aug 19, 3:13 pm, Tokasa toka...@gmail.com wrote:
 Hi Jörn and Anoop,
 thanks for your reply to my question...I have made a clear example.
 Please have a look over here...

 http://www.tokasa.cz/temp/example.html

 Please tell me what is missing or is wrong, because I dont see it :)

 Thanks
 Tomas

 On Aug 19, 1:50 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:

  Then your code isn't the same. Go back to the example and look at
  where the validator-variable is defined.

  If that doesn't work out, post a testpage, or at least your full code.

  Jörn

  On Wed, Aug 19, 2009 at 11:51 AM, Tokasatoka...@gmail.com wrote:

   Hi,
   anybody have experience with this validation plugin?
  http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html

   I need to know how to specify corectly the resetForm() function.

   Simply I need to have submit button to continue (which validates
   before) AND I need to have second submit button which which will go
   step back in my wizard and WILL NOT validate.

   on the link above, in that example it works nicely...but in my
   settings does not.. I have also tried their jquery library etc... but
   did not helped.

   My code is ...the same as in link above..

   $(#PreviousBtn).click(function() {
     validator.resetForm();
   });

   but firebugs tells me...
   validator is not defined
   validator.resetForm(); \n

   Thanks
   Tomas


[jQuery] Re: JQuery [Validate plugin] - Placement of error text

2009-08-19 Thread Jörn Zaefferer

Take a look at the options related to error messages:
http://docs.jquery.com/Plugins/Validation/validate
Especially errorPlacement should be what you are looking for.

Jörn

On Wed, Aug 19, 2009 at 9:39 PM, Fongf...@weblite.ca wrote:

 Hi all,

 I am using the jquery form validation plugin (http://docs.jquery.com/
 Plugins/Validation) to get some simple validation done on my form.
 It's working perfect so far.  When I set a particular form field to
 have the class required that makes it so that it can't be blank and
 when the user tries to submit the form, JQuery displays a This field
 is required. text beside the field and focuses on it.  The text
 generally appears right beside the input element.

 I was wondering whether it is possible to actually control where the
 error text appears?  Say like I set an element div element which I
 want the error to appear.  Is there a way to make it the error text
 appear in that div element?

 Thanks!




[jQuery] Re: [validate]

2009-08-18 Thread Jörn Zaefferer

There is no gurantee that the form will actually be submitted after
submitHandler is called. So the cleanup is necessary for future
submits of the same form.

Could you show your full code? I suspect the actual issue is elsewhere.

Jörn

On Tue, Aug 18, 2009 at 2:14 PM, L.Ours.POlaiRlourspol...@banquiz.net wrote:

 system :

 JQuery : 1.3.1
 Validate plugins 1.5.5

 #

 problem : form validation with button under chrome(test under chrome
 3.x and chrome 4.0.201.1)
 the button value is not sent to POST or GET



 solution :
 change line 70
 ##
 if (validator.submitButton){
        // and clean up afterwards; thanks to no-block-scope, hidden can be
 referenced
        hidden.remove();
 }
 ##

 by this

 ##
 if (validator.submitButton) {
        // and clean up afterwards; thanks to no-block-scope, hidden can be
 referenced
        // hidden.remove();
 }
 ##



 I think the problem become from Chrome JS engine, which jump the
 validator.settings.submitHandler.call action.
 Why did you remove hidden input ? just for cleaning a form which
 already sent ?

 thanks for supporting.
 Cordialy,
 L.Ours.POlaiR | Creabilis





[jQuery] Re: [validate]

2009-08-18 Thread Jörn Zaefferer

Okay, that looks fine so far. Could you file a ticket here?
http://plugins.jquery.com/node/add/project-issue/validate (needs
login/registration); Please attach that testpage with the description.

Thanks
Jörn

On Tue, Aug 18, 2009 at 4:11 PM, L.Ours.POlaiRlourspol...@banquiz.net wrote:

 hi,

 In fact all work fine under, IE6, IE7, IE8, FF3.5, juste this problem
 under Chrome and Safari (same engine as Chrome)


 in which case form will not be sent ?
 - if all validate this sent
 - if one mismatch handler stop before hidden input created.

 here a sample to reproduced problem (don't forget to adjust path for
 JQ, validate JS en CSS ;) ) :

 ##
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
 www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 meta http-equiv=Content-Type content=text/html; charset=utf-8 /
 titleDocument sans titre/title
 link rel=stylesheet type=text/css href=../CSS/
 jquery.validate.css /
 script type=text/javascript src=../js/jquery.js/script
 script type=text/javascript src=../js/jquery.validate.js/
 script
 script type=text/javascript
 $(document).ready(function()
 {

        $(#formulaire).validate(
        {

                rules: {
                        f_description: required,
                        f_montantTTC: required
                },
                messages: {
                        f_description: il faut une description,
                        f_montantTTC: il faut un montant
                },
                success: function(label) {
                                label.text( ).addClass(success);// str 
 vide pour faire
 apparaitre l'icone OK
                },
                submitHandler: function(form) {
                                $('.B').attr('disabled', 'disabled');
                                form.submit();
                }
        });

 });
 /script
 /head

 body
    form name=formulaire id=formulaire method=get action=
        plabelMontant TTC/labelinput type=text
 name=f_montantTTC id=f_montantTTC value=//p
        plabelDescription/labeltextarea name=f_description
 id=f_description cols=45 rows=20/textarea/p
        button type=submit name=buttondepotReponse
 id=buttondepotReponse class=B value=ValiderspanValider/
 span/button
    /form
 /body
 /html

 ##


 thanks for your interrested.
 L.Ours.POlaiR | Creabilis



 On 18 août, 15:16, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
 There is no gurantee that the form will actually be submitted after
 submitHandler is called. So the cleanup is necessary for future
 submits of the same form.

 Could you show your full code? I suspect the actual issue is elsewhere.

 Jörn

 On Tue, Aug 18, 2009 at 2:14 PM, L.Ours.POlaiRlourspol...@banquiz.net 
 wrote:

  system :

  JQuery : 1.3.1
  Validate plugins 1.5.5

  #

  problem : form validation with button under chrome(test under chrome
  3.x and chrome 4.0.201.1)
  the button value is not sent to POST or GET

  solution :
  change line 70
  ##
  if (validator.submitButton){
         // and clean up afterwards; thanks to no-block-scope, hidden can be
  referenced
         hidden.remove();
  }
  ##

  by this

  ##
  if (validator.submitButton) {
         // and clean up afterwards; thanks to no-block-scope, hidden can be
  referenced
         // hidden.remove();
  }
  ##

  I think the problem become from Chrome JS engine, which jump the
  validator.settings.submitHandler.call action.
  Why did you remove hidden input ? just for cleaning a form which
  already sent ?

  thanks for supporting.
  Cordialy,
  L.Ours.POlaiR | Creabilis


[jQuery] Re: [validator] Display error messages in a convenient location per each

2009-08-18 Thread Jörn Zaefferer

You can use the errorPlacement-option for that, replacing the default
insertAfter(element) with appendTo(element.parent())

Jörn

On Tue, Aug 18, 2009 at 6:33 PM, IvanHalenivanha...@tin.it wrote:
 Hello,
 I'm playing with the great Bassistance jQuery Validator and am stuck
 at a point
 The idea is simple: I have lot of this markup (I semplify, but the
 idea is that after each input there could be something else, i.e. a
 word, an icon, etc... that is inline with the correspondinginput):

 ol
 liinput type=text id=width size=3/input px/li
 liinput type=text id=height size=3/input px/li
 liinput type=text id=thumb size=3/input px/li
 /ol

 Well, the Validator forces the error messages to appear just after
 the input, so I get something like:

 [input] insert a number here px
 [input] insert a number here px
 [input] insert a number here px

 In other words, the error messages split the natural flow of the
 line

 The best would be to put the error message on a line after the input
 +following element, so:

 [input] px
  insert a number here
 [input] px
 insert a number here
 [input] px
 insert a number here

 But there's no way to reach this

 Wrapping the input and the following element in a div has no
 effect, since the error message alway go after the input and not
 after the wrapper div

 The error container demo (http://jquery.bassistance.de/validate/demo/
 errorcontainer-demo.html) does not match my needs since it wraps ALL
 errors in a single div - but the idea of showing the error NOT close
 to the input is nice

 Please, can you help? Is there a solution for this?
 Thanks



[jQuery] Re: [tooltip] integration with jQuery UI

2009-08-17 Thread Jörn Zaefferer

Works fine for me with extraClass. To change it once for all tooltips:

$.tooltip.defaults.extraClass = ui-widget ui-widget-content ui-corner-all;

Jörn

On Thu, Aug 13, 2009 at 8:25 PM, tvanfossontvanfos...@gmail.com wrote:

 I've made some minor modifications to the Tooltip plugin to have it
 integrate with jQuery UI.  I'm wondering, though, if this has already
 been done.  I couldn't get it to work reliably with the extraClass
 option (sometimes the styles didn't seem to be applied in IE anyway)
 so I extended the options with a uiClasses option that by default is
 set to ui-widget ui-widget-content ui-corner-all and set these as
 the default class when the tool tip is created.  This seems to work
 reliably, but I don't want to reinvent the wheel, especially if there
 are things that I've missed in my limited testing.

 defaults: {
   delay: 200,
   fade: false,
   showURL: true,
   extraClass: ,
 new   uiClasses: ui-widget ui-widget-content ui-corner-all,
   top: 15,
   left: 15,
   id: tooltip
 },

 function createHelper(settings) {
   // there can be only one tooltip helper
   if( helper.parent )
      return;
  // create the helper, h3 for title, div for url
  helper.parent = $('div id=' + settings.id
 new                              + ' class=' + settings.uiClasses
                                          + 'h3/h3div
 class=body/divdiv class=url/div/div')



[jQuery] Re: Citation for jQuery

2009-08-12 Thread Jörn Zaefferer

Hi Nathaniel,

what exactly do you want to cite? Its not clear from your question.

Regards
Jörn

On Tue, Aug 11, 2009 at 9:15 PM, Nathanielnathaniel.t...@gmail.com wrote:

 Hello Devs:

 I'm preparing an academic paper in which I want to cite jQuery and
 jQuery UI.  Is there a specific publication you would recommend? At
 present I've got jQuery Reference Guide by Caffer and Swedberg, but
 perhaps there's an article somewhere which is more appropriate?

 Just want to give credit where it's due.

 --Nathaniel Tagg



[jQuery] Re: Post variable array

2009-08-12 Thread Jörn Zaefferer

What values do the variables action  and postThis contain? You
describe them as actions, isn't telling me anything.

Jörn

On Wed, Aug 12, 2009 at 7:40 PM, cz231cz2...@gmail.com wrote:

 Hi,

 I'm using AJAX to submit a form. I'm using the POST method. Example:

 $.post(action, postThis);

 Both action and postThis are actions. Action is the URL and postThis
 is the data to be submitted. Right now, this isn't working. I know I
 can pass the action variable because that has always been working. But
 how do I put the parameters there as a variable? It will work if I
 express the parameters like this:

 $.post(action, {Name: Jimmy, Username: Something, Password:
 something, Email: someth...@someplace.com });

 Any help would be greatly appreciated.




[jQuery] Re: Bind Validate to button click event

2009-08-12 Thread Jörn Zaefferer

Try this:

 $('#searchButton').click(function(){
  if ($('#testBlog').valid())
   formDoAjaxSubmit();
   });

Jörn

On Wed, Aug 12, 2009 at 8:04 PM, Rockinelleericbles...@gmail.com wrote:

 I am walking into an existing form that uses a custom ajax request to
 display search results at the button of the page. This is triggered by
 clicking a form button. I want to trigger the validation on this same
 click event rather than a submit event. I am just using basic
 validation at the moment.


 script type=text/javascript charset=utf-8
 $(document).ready(function(){
        $('#testBlog').validate();

        $('#searchButton').click(function(){
                formDoAjaxSubmit();
        });
 });
 /script

 form id=testBlog name=testBlog
        select name=catSelectList id=catSelectList class=required
 title=Please Select a Category style=width:610px 
                option/option
                option/option
                option/option
                option/option
         /select
         input type=button value=Submit this Query!
 id=searchButton
 /form



[jQuery] Re: [validate] Refreshing the validator after dynamically adding a class to an element

2009-08-11 Thread Jörn Zaefferer

Give that a try: .toggleClass(required)

In your approach, its likely that the metadata isn't picked up, so
you'd have to manually remove the cached metadata, via
.data(metadata, null)

Jörn

On Tue, Aug 11, 2009 at 3:06 AM,
Jean-Micheljean-michel.godin-dug...@voluzion.ca wrote:

 Hi,

 I know the refresh() method is gone since version 1.2 but for some
 reason even if it's suposed to work without it I can't get it to work.

 Here's the scenario:

 I got a select box, depending on the selection I want certain element
 to validate so I dynamically add validation class to those element
 like this.

 $(input#element).toggleClass({validate:{required:true}});

 But when I click submit the element doesn't get validated at all but I
 can see the class has been added in firebug.

 Any clues what could be the problem?



[jQuery] Re: Disable submit button with Validation plugin

2009-08-10 Thread Jörn Zaefferer

Try this:

$(document).ready(function() {
   $(#myForm).validate({
 submitHandler: function(form) {
   $(form).find(:submit).attr(disabled, true).attr(value,
Submitting...);
   form.submit();
}
  })
});

Jörn

On Mon, Aug 10, 2009 at 9:40 AM, Rich Sturimcosmos99...@gmail.com wrote:
 $(document).ready(function() {
    $(#myForm).validate()
 });


[jQuery] Re: VALIDATION not validating when submit button clicked....

2009-08-10 Thread Jörn Zaefferer

Please show the rest of your code.

Jörn

On Mon, Aug 10, 2009 at 11:49 PM, Miket3miketro...@gmail.com wrote:

 Here is my handler:

   submitHandler: function(form) {
     alert('I CANT GET THIS TO TRIGGER');
  },


 Here is my button:

 input class=submit type=submit id=register value=Register

 How do i trigger a validate when the submit button is clicked?

 All of my validations work while I am working with the form but the
 button does zilch.


[jQuery] Re: more VALIDATION issues

2009-08-09 Thread Jörn Zaefferer

Your assumption that the remote method is buggy is not at all
verified, or: wrong. Instead of trying to write your own
remote-method, please provide a testpage to find the actual issue
you're dealing with.

Jörn

On Sun, Aug 9, 2009 at 7:07 PM, Miket3miketro...@gmail.com wrote:

 OK.  the validation plugin is kicking my ass. as does every new thing
 I try to learn.

 FIRST: I need to clarify that there is a BUG up front so someone
 doesn't offer it as a solution.
 I am using version 1.5.5. It has a bug in the REMOTE rule/method so
 this is not an option to check for duplicate entries. And I know this
 because I set my lookup.php server script to a single line of ECHO
 FALSE but the validator plugin still adds a valid to the element
 class. Plus this was an issue in previous releases so it is more than
 likely re-introduced. BUT if you think I am still wrong I am open to
 suggestions so long a s they are detailed.

 So with that issue behind me I went out and learned how to create a
 custom method using the $.validator.addMethod() to solve my problem.
 And now I have run into 2 more issues which are stopping me. If
 someone can solve any 1 of these next 2 issues, I can be on my way.

 1. I don't know how to grab a value returned from $.get() and put it
 into a javascript variable that can be used outside the scope of the
 $.get() event because I need to return that value .  I have tried
 setting global variables all over the place but nothing gets set.

 2. I also tried to just add an attribute to the element with the
 return value, then use jquery to fetch that value. But there seems to
 be a cache issue along the way. The attrib is being set correctly
 (according to firebug) but the value is always 1 cycle behind. Oh...
 and I do have CACHE:FALSE set.

 so if anyone can help here is my code:

 $.validator.addMethod(dupcheck,function(value,element){

    var lookupkey = $(element).attr(name);
    var lookupvalue = $(element).val();
    var thisid = $(element).attr(id);
    var valid_img = 'img src=/global_libs/images/icons/
 checked.gif';
    var error_img = 'img src=/global_libs/images/icons/
 unchecked.gif';

    $.get('lookup.php', {table : members, key : lookupkey, value :
 lookupvalue, successmsg:false, failmsg:true }, function(data){  [I
 NEED THE VALUE OF (DATA) TO BE RETURNED FROM HERE]  });
 });

 ok I will through in the server script as well:

 here is my LOOKUP.PHP
 ?

 $noheaders = true;  //prevents config.php from loading any header
 data such a scripts and styles.
 include(config.php);
 $table = $_GET[table];
 $key = $_GET[key];
 $value = $_GET[value];
 $failmsg = (isset($_GET[failmsg]) ? $_GET[failmsg] : $value.: Not
 Found in TABLE: .$table. for KEY: .$key);
 $successmsg = (isset($_GET[successmsg]) ? $_GET[successmsg] :
 $value.: Found in TABLE: .$table. for KEY: .$key);
 $sql=SELECT * FROM $table WHERE $key='$value' ;
 $result=mysql_query($sql);
 if (mysql_num_rows($result)  0) {
  echo $successmsg;
 } else {echo $failmsg;  };

 ?

 Thanks,
 MIke



[jQuery] Re: [validate] Problem with custom methods and eager/lazy validation

2009-08-07 Thread Jörn Zaefferer

You've got the this.optional(element) stuff included, so that method
works just like the builtin methods, unless something else is broken.

Jörn

On Thu, Aug 6, 2009 at 10:37 PM, Jim Evansximxim...@googlemail.com wrote:

 Hi,

 I'm using the validator plugin and it's great! I understand the
 following:

 Before a field is marked as invalid, the validation is lazy: Before
 submitting the form for the first time, the user can tab through
 fields without getting annoying messages - he won't get bugged before
 he had the chance to actually enter a correct value

 This is cool and how I want it to work.

 However, I have some custom validation methods using addMethod like:

 $.validator.addMethod(currency, function(value, element){
        element.value = $.trim(value);
        return this.optional(element) || /^([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(\.
 [0-9]{2})?$/.test(element.value);
    }, 'This value should be in the form 1234, 1234.56 or 1,234.56');

 These custom methods validate eagerly from the start, i.e. before I've
 tried to submit the form. This means that in a form with one input
 using say this 'currency' method, and another input using the built in
 'required' method, as I tab through them, the required one will not be
 validated but the currency one will.

 How can I ensure that these custom validation methods only validate
 after initial submit/validation has occurred, like the built in ones
 do?

 Many thanks,

 Jim.



[jQuery] Re: Complex form hiding input depending on a tick box

2009-08-06 Thread Jörn Zaefferer
The marketo demo includes something very similar, take a look at that:
http://jquery.bassistance.de/validate/demo/marketo/step2.htm

Jörn

On Thu, Aug 6, 2009 at 10:44 AM, Francois
(Jersey)francois.ches...@googlemail.com wrote:

 I am writing an accounting sofware, and I have difficulties with the
 form used to enter the debit and credit for a given transaction.


 I have used the Jquery validation plugin demo, but I don't know how to
 hide a specific input cell and replace it by blanks.

 In accounting, you have either a credit or a debit. So I have an
 indicator tick box at the beginning of each line which defines whether
 the line is a debit or credit, and if so it hides the credit cell or
 debit cell.

 Would you mind looking at the example below and let me know how it
 could be done?

 Thanks,

 Francois




 /head
 body



 h1 id=bannera href=http://bassistance.de/jquery-plugins/jquery-
 plugin-validation/jQuery Validation Plugin/a Demo/h1

 div id=main



 textarea style=display:none id=template

        tr

                td



                /td

                td class='type'
                input id=checkme-{0} type=checkbox
 name=debitcredit value=D
                /td
                td class='account_from_chart'
                        select

                                option value=1Income/option
                                option value=2Expense/option

                        /select

                /td
                div id=debit
                td class='debit'

                        input size='4' class=quantity min=1 
 id=item-quantity-{0}
 name=item-quantity-{0} /

                /td
                /div
                div id=credit 
                td class='credit'

                        input size='4' class=quantity min=1 
 id=item-quantity-{0}
 name=item-quantity-{0} /

                /td
                div
                td class='currency'
                        select name=item-type-{0}

                                option value=USDUSD/option
                                option value=GBPGBP/option

                        /select
                /td
                /td

                td class='debit_functional'

                        input size='4' class=debit_functional min=0.01 
 id=item-
 quantity-{0} name=item-quantity-{0} /

                /td
                td class='credit_functional'

                        input size='4' class=credit_functional min=0.01 
 id=item-
 quantity-{0} name=item-quantity-{0} /

                /td
                td button id=delete_lineDelete/button  /td
                td class='quantity-error'/td

        /tr

 /textarea




 form id=orderform class=cmxform method=get action=foo.html

        h2 id=summary/h2

        fieldset

                legendExample with custom methods and heavily customized 
 error
 display/legend

                table id=orderitems
                        tbody

                        /tbody
                        tfoot
                                tr/tr


                                tr
                                        td colspan=9/td
                                        td class=totaldebitinput 
 id=totaldebit name=totaldebit
 value=0  readonly=readonly size='4' //td
                                        td class=totalcreditinput
 id=totalcredit name=totalcredit value=0 readonly=readonly
 size='4' //td
                                /tr


                                tr

                                        td colspan=2nbsp;/td

                                        tdinput class=submit 
 type=submit value=Submit//td

                                /tr
                        /tfoot

                /table
        /fieldset

 /form

 button id=addAdd another input to the form/button



 h1 id=warningYour form contains tons of errors! Please try again./
 h1

 pa href=index.htmlBack to main page/a/p



 /div


 script src=http://www.google-analytics.com/urchin.js; type=text/
 javascript
 /script
 script type=text/javascript
 _uacct = UA-2623402-1;
 urchinTracker();
 /script
 /body
 /html



 /head
 body
        div style=width: 500px;

                form
                        label for=nameName:/label
                        input id=name type=text
                        label for=checkboxCheck to enter your email 
 address:/label
                        input id=checkme type=checkbox /
                        div id=extra
                                label for=emaildebit:/label
                                input id=email type=text /

                        /div
                        div id=extra2
                                label for=emailcredit:/label
                                input id=email type=text /

                        /div

                /form
 /body
 /html




[jQuery] Re: Are the OAuth Consumer Token and Secret assigned to a specific Server IP address

2009-08-05 Thread Jörn Zaefferer

Uh, wrong list? This list is about jQuery, seems mostly unrelated...

Jörn

On Wed, Aug 5, 2009 at 2:06 AM,
MECarluen-TwitterGroupmecarl...@gmail.com wrote:

 Hello Gurus- quick question, are the Consumer Token and Secret
 assigned to a specific Server IP address?

 I am currently switching my servers/hosts to a different IP address,
 but with same domain name. It seems like Oauth returns a Failed to
 validate oauth signature and token when using the same consumer
 tokens and secrets on the new IP addy. If this is what is causing my
 problem, how do I remedy?

 Thanks for for confirming one way or the other... comments welcome.



[jQuery] Re: How to modify the url function [validate]

2009-08-05 Thread Jörn Zaefferer

I recommend to use the url method, than add a custom method
(http://docs.jquery.com/Plugins/Validation/Validator/addMethod) that
checks your requirement. That way your method can rely on a valid URL.

Jörn

On Wed, Aug 5, 2009 at 6:18 AM, Fongf...@weblite.ca wrote:

 Hi all,

 This post is in regards to the jQuery plugin for validation.  I am
 using the url method to get validation text fields which I want to
 have a url.  But I want a slight modification where I only want to the
 base directory of a site and not an individual page.  For example, I
 want http://www.example.com and not something like 
 http://www.example.com/index.html.

 Is there anyway to utilize the url method to do this for me?

 Thanks,



[jQuery] Re: validate

2009-08-03 Thread Jörn Zaefferer

The syntax is just fine:

rules: {
 bla.blu.blub: required
}

See also 
http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_complex_names_.28brackets.2C_dots.29

Jörn

On Mon, Aug 3, 2009 at 8:42 AM, Stanislas Zaychenkozak...@gmail.com wrote:
 Hi Jörn,
 Thanks for reply,

 now here the context why I need to use id instead of name
 I have a form somethink like this:

 form
 div class=box-col-l
    div class=det-prptylabel for=FirstNameFirst Name:*/label/div
    div class=det-valueinput id=txtPersonFirstName
 name=Order.CustomerPerson.FirstName type=text value= //div
    div class=det-prptylabel for=LastNameLast Name:*/label/div
    div class=det-valueinput id=txtPersonLastName
 name=Order.CustomerPerson.LastName type=text value= //div
    div class=det-prptylabel for=EmailEmail:*/label/div
    div class=det-valueinput id=txtPersonEmail
 name=Order.CustomerPerson.Email type=text value= //div
    div class=det-prptylabel for=TelephoneTelephone:*/label/div
    div class=det-valueinput id=txtAddressPhoneNumber
 name=Order.Address.PhoneNumber type=text value= //div
    div class=det-prptylabel for=CompanyCompany:/label/div
    div class=det-valueinput id=txtPersonCompany
 name=Order.CustomerPerson.Company type=text value= //div
 /div
 /form

 so, as you can see the name attribute is already used for server side
 processing,  it's .net syntax doesn't work within validate plugin for
 construction {rules:{
     fieldName:value
     }
 }

 Certainly, I can add rules for each form input separately using
 $(#inputId).rules(), but it looks a bit ugly if we have many fields are
 been validated

 Stani


 2009/7/30 Jörn Zaefferer joern.zaeffe...@googlemail.com

 The plugin supports only names, you'd have to hack the plugin to change
 that.

 If you provide some context on why you think you need that, it would
 be easier to propose a solution.

 Jörn

 On Wed, Jul 29, 2009 at 8:15 AM, zaka29zak...@gmail.com wrote:
 
  Hi,
 
  Please give advise, how to assign rules for form elements using their
  ids attributes instead of name e.g
 
  rules:{
           name: required, //plugin retrieves form element by name,
  but should be id
           email: required
         }
 
  Thanks
 




[jQuery] Re: [validate] - translate generic error messages

2009-08-03 Thread Jörn Zaefferer

$.validator.message.requires = my new default message;

Or use on of the provided localization files (in the zip file).

Jörn

On Mon, Aug 3, 2009 at 6:40 AM, Jnewidn...@gmail.com wrote:

 Plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/

 How translate generic error messages, without editing the javascript
 file?

 My test:
                messages: {
                                required: Don't work,
                        username: {
                                required: Work
                        },
                        email: Work
                }


 But I need to change one by one? I just want all the messages required
 to be changed and not a specific field.

 Exemple:
 change all This field is required.
 to Campito el obrigatoriozito delo prenxings. Thanks!



  1   2   3   4   5   6   7   8   9   10   >