[jQuery] Validator Plugin ajaxSubmit

2008-11-11 Thread lance123

Hi To All,

I am having a problem with Safari using the standard test example the
loading image starts prior to any activity in fields or buttons:

http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html

Really looking forward to getting ajax and validation co-existing :)

Thanks for any help on this,

Lance




[jQuery] Re: ajaxform validation submission probs

2008-11-11 Thread lance123

Thanks Jorn,

I will give that a go :)

Lance

On Nov 11, 7:24 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Check this 
> example:http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-de...
>
> Use ajaxSubmit instead of ajaxForm and put that into the submitHandler.
>
> Jörn
>
> On Tue, Nov 11, 2008 at 9:19 AM, lance123 <[EMAIL PROTECTED]> wrote:
>
> > Hi To All,
>
> > I am trying to get the jquery ajaxform plugin to work with the
> > validate plugin and I cannot seem to get submission right!  It will
> > not stop the submission process no matter what I do. :(
>
> > Here is my test code...any help much appreciated.  Thanks Lance
>
> > $.validator.setDefaults({
> >        submitHandler: function() { alert("submitted!"); }
> > });
>
> > $().ready(function() {
>
> >        // validate signup form on keyup and submit
> >        $("#formaaa").validate({
> >                rules: {
> >                        username: {
> >                                required: true,
> >                                minlength: 2    },
>
> >                },
> >                messages: {
> >                        username: {
> >                                required: "Please enter a username",
> >                                minlength: "Your username must consist of at 
> > least 2 characters"
> >                        },
> >                }
> >        });
> > });
>
> >  var FormID;
> >   $(document).ready(function () {
>
> >        //Bind the mouseover function to the form element
> >  $("form").bind("mouseenter mouseleave", function(e){
> >        FormID=(this.id);
> >    // bind form using ajaxForm
> >    $('#'+FormID).ajaxForm({
> >        // target identifies the element(s) to update with the server
> > response
> >        target: '#htmlExampleTarget'+FormID,
> >        url: 'html-echo.php',
>
> >        // success identifies the function to invoke when the server
> > response
> >        // has been received; here we apply a fade-in effect to the
> > new content
> >        success: function() {
> >            $('#htmlExampleTarget'+FormID).fadeIn('slow');
> >        }
> >    });
> > });
> > });
> >  
> >  
> >  p { background:yellow; font-weight:bold; cursor:pointer;
> >      padding:5px; }
> >  p.over { background: #ccc; }
> >  span { color:red; }
> >  
>
> > 
> > 
>
> > 
> >    Message:  > id="username" class="required" minlength="10" />
> >    
> > 
> >            htmlExampleTarget (output will be added below):
> >            
>
> > 
> > 


[jQuery] ajaxform validation submission probs

2008-11-11 Thread lance123

Hi To All,

I am trying to get the jquery ajaxform plugin to work with the
validate plugin and I cannot seem to get submission right!  It will
not stop the submission process no matter what I do. :(

Here is my test code...any help much appreciated.  Thanks Lance

$.validator.setDefaults({
submitHandler: function() { alert("submitted!"); }
});

$().ready(function() {

// validate signup form on keyup and submit
$("#formaaa").validate({
rules: {
username: {
required: true,
minlength: 2},

},
messages: {
username: {
required: "Please enter a username",
minlength: "Your username must consist of at 
least 2 characters"
},
}
});
});

  var FormID;
   $(document).ready(function () {

//Bind the mouseover function to the form element
  $("form").bind("mouseenter mouseleave", function(e){
FormID=(this.id);
// bind form using ajaxForm
$('#'+FormID).ajaxForm({
// target identifies the element(s) to update with the server
response
target: '#htmlExampleTarget'+FormID,
url: 'html-echo.php',

// success identifies the function to invoke when the server
response
// has been received; here we apply a fade-in effect to the
new content
success: function() {
$('#htmlExampleTarget'+FormID).fadeIn('slow');
}
});
});
});
  
  
  p { background:yellow; font-weight:bold; cursor:pointer;
  padding:5px; }
  p.over { background: #ccc; }
  span { color:red; }
  






Message: 


htmlExampleTarget (output will be added below):







[jQuery] Re: jQuery object with variable id name. Is is possible?

2008-11-09 Thread Lance123


Hi AliUK-2,

Did you ever get a solution to this?  I need to do the same thing and it
seems hard to do in jquery.

I can easily do it in standard js but can't pass the variable to jquery.


function checkFormName(obj,formobj) {
 formAname=formobj.name
 
 if(obj.checked==true) 
 {

document.forms[formAname].Purchased.value="yes";
 }
else
{ 
document.forms[formAname].Purchased.value="";
}
}




Let me know if you found out anything or you can pass the variable above to
Jquery somehow?  I have not found a way.

Thanks,

lance
  

AliUK-2 wrote:
> 
> 
> Hi,
> is it possible to passed the jQuery object a variable with the the js
> functions for example?
> I'm having problems with jQuery. I have an img that on click it runs
> this function however nothing gets hidden or shown.
> 
> I have the following in my page header
> 
> 
> Code:
> function hide_Show(RegionID)
>var $jQuery = jQuery.noConflict();
> //Icon that is clicked
>var objectClickedID = '#' + RegionID + '_img';
> //Region to hide
>var objectID = '#' + RegionID;
>$jQuery(document).ready(function(){
>   $jQuery(objectClickedID).click(function() {
> if ($x(objectID).style.display =='none') {
>   $jQuery(objectID).show('slow');
> }
> else{
>   $jQuery(objectID).hide('slow');
> }
>   });
> }
> and my img is as following
> 
> 
> Code:
>  and my region that I want to hide is
> Code:
> Hide thisI know you might say that I could
> just hard code the div ID though I have a lot of divs and they img's
> need to hide specifc divs.
> 
> 
> Thanks for your support.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/jQuery-object-with-variable-id-name.-Is-is-possible--tp20268403s27240p20411033.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: get form id from button click

2008-11-07 Thread lance123

HI Klause,

Thanks for that :) where to I set this up.  I have been able to do
this sort of thing with standard js but not integrating it with
jquery.

I put this inline javascript in the button function that calls the
ajax

"javascript:checkFormName(this.form.id);"

But can't get work out how to pass the variable.

On Nov 8, 9:25 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> And remember you don't have to use jQuery for everything where a
> this.id is sufficient.
>
> var myId = this.id;
>
> But that wasn't the question anyway, Lance needed the id of the form
> that contains the button, not the id of the button itself. The form's
> id would be:
>
> var formId = this.form.id;
>
> --Klaus
>
> On 7 Nov., 22:12, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
>
> > After you've clicked the submit button for a form:
>
> > Var myID = $(this).attr('id');
>
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> > Behalf Of lance123
> > Sent: Friday, November 07, 2008 3:09 PM
> > To: jQuery (English)
> > Subject: [jQuery] get form id from button click
>
> > Hi To All,
>
> > How do I get the form id from a button click.
>
> > I have multiple forms with dynamic id's and want to get the id to pass it
> > back to an ajax form function ie
>
> > $("#"+form_id)
>
> > any help much appreciated.
>
> > Thanks,
>
> > Lance


[jQuery] Re: get form id from button click

2008-11-07 Thread lance123

Hi Andy,

Thanks for that.  I am a bit of a Jquery noob.  Where do set the Var
myID and how will it know it's the form?

Here is my ajax function:

$(document).ready(function() {
// bind form using ajaxForm
$('#'+myID).ajaxForm({
// target identifies the element(s) to update with the server
response
target: '#htmlExampleTarget',

// success identifies the function to invoke when the server
response
// has been received; here we apply a fade-in effect to the
new content
success: function() {
$('#htmlExampleTarget').fadeIn('slow');
}
});
});

On Nov 8, 8:12 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
> After you've clicked the submit button for a form:
>
> Var myID = $(this).attr('id');
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of lance123
> Sent: Friday, November 07, 2008 3:09 PM
> To: jQuery (English)
> Subject: [jQuery] get form id from button click
>
> Hi To All,
>
> How do I get the form id from a button click.
>
> I have multiple forms with dynamic id's and want to get the id to pass it
> back to an ajax form function ie
>
> $("#"+form_id)
>
> any help much appreciated.
>
> Thanks,
>
> Lance


[jQuery] get form id from button click

2008-11-07 Thread lance123

Hi To All,

How do I get the form id from a button click.

I have multiple forms with dynamic id's and want to get the id to pass
it back to an ajax form function ie

$("#"+form_id)

any help much appreciated.

Thanks,

Lance


[jQuery] validator plugin dynamic form names

2008-11-05 Thread lance123

Hi Jorn,

Really like the plugin!  How do use dynamic form names?  I have tried
numerous methods but it won't accept my variable.

ie $("#"+MyFormName)

My variable is set ok but it just does not seem to work.  The reason I
want to do this is because I am dynamically creating the form names
from variables in php.  There is also about 20 per page.

A second question is how do I call my own ajax function instead of
submit.  The function is  an