Sorry forgot the code:
$("#field").rules("add", {
remote: {
url:"test.asp",
type: "post",
data: {fieldvalue: function(){
if ($("#field").val() == "")
return "empty";
else
return $("#field").val();
May be a dumb suggestion, but can't you set the value as "empty" when
there is no value?
On Dec 6, 7:53 pm, david wrote:
> Hi all,
>
> I want to make a remote validation on an empty field. Sometimes the
> field may be empty and sometimes not. This depends on the selection of
> other elements. I s
Thanks for your reply.
This is what I have.
function validateName(button) {
txtName.rules('add', {
remote: {
url: 'validate.ashx'
, data: ({id: txtName.attr('name')})
}
}
, messages: {
remote: '* Error'
}
});
Not easy to solve - you could use $().ajaxStop() to wait for the
request to finish, then you valid() again, this time it will validate
the cached value and return the correct result.
Jörn
On Wed, May 6, 2009 at 8:00 AM, Mekilioz wrote:
>
> I'm trying to do a jquery remote validation on a 'Name'
On 23 mar, 16:10, MartinBorthiry wrote:
> Hello:
> I'm using the validation plugin on my site to make remote
> validations, and it is working graet!
> But, I note that the ajax call is made allways. I think that that
> call only has to be done when the input value has changed. Has no
> sens
You can replace the url-string with ajax-options:
remote: {
url: "filename.php",
data: {
field2: function() { return $("#field2").val() }
}
}
Jörn
On Fri, Mar 6, 2009 at 2:43 AM, danc wrote:
>
> Hi:
> I have a warranty registration form where I am using validate.js to
> validate the
Error found:
echo "false";
} else {
echo "true";
}
Do not response with boolean, string is expected.
On 23 Feb., 18:13, Sonya wrote:
> For remote validation, please show a code of check-email.php. I did
> not find any example. My code:
>
> $email=$_POST['email'];
> $existi
Wow..Jörn you're just great!!
Thanks a lot!
It works in chrome, firefox and ie6...
On 27 Nov, 13:16, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Thats test code, nothing useful for an application. The code I posted
> is what you'll want to use:
>
> $("#myform").validate({
> rules: {
> use
Thats test code, nothing useful for an application. The code I posted
is what you'll want to use:
$("#myform").validate({
rules: {
username: {
required: true,
remote: {
url: "checkusername.php",
type: "post"
data: {
email: function() { return $("#email")
hi
i just needed that option today!!
for the moment i just found a not-very-good way out which works for
me.
Among the pages you suggested i found this:
test("remote, customized ajax options", function() {
expect(2);
stop();
var v = $("#userForm").validate({
With the 1.5 release you will be able to use this instead:
$("#myform").validate({
rules: {
username: {
required: true,
remote: {
url: "checkusername.php",
type: "post"
data: {
email: function() { return $("#email").val() }
}
}
The current workaround I recommend is to use ajaxSend:
$().ajaxSend(function(e, xml, settings) {
$.extend(settings.data, { field2: $("#field2").val() });
});
With the drawback that it gets applied to all ajax requests. Depends
on your application if thats a problem and how to avoid it.
Jörn
On
I couldn't replicate the issue you describe, so I assume the problem
is on your serverside - nothing I could fix in the validation plugin.
Jörn
On Wed, Jun 18, 2008 at 8:21 PM, cryptid <[EMAIL PROTECTED]> wrote:
>
> I am using Jörn's validation plugin to validate a form and I want to
> validate
13 matches
Mail list logo