Well, we don't have worship service on Sunday night, so I'm just hanging around eating honey BBQ wings and working on this js...
Anyway... you can view the form I'm working on here: http://bodaford.whitestonemedia.com/html/featured_property_details.cfm?Property_ID=1 Scroll down until you see "Click here to calculate mortgage payment." Click that link and the form will appear. Rick -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ???? Sent: Sunday, March 11, 2007 9:13 PM To: jQuery Discussion. Subject: Re: [jQuery] Need someone to help me understand my syntax error in validation plug-in... I notice that you're defining a function in the standard GLOBAL way and expect it to be LOCAL var localfunction = function(){.....} is a local function and the clientX and clientY are the coordinates of the click.. (not exciting here) it's hard to give great advise without a live link! But it's Sunday and everybody is off drinking or praying or convening! So I figure I'd add my 2 cents. On 3/11/07, Rick Faircloth <[EMAIL PROTECTED]> wrote: > Seems obvious, but I wonder why it wasn't a problem before... > > Anyway, that problem went away, but now Firebug is returning this error: > > "CalculateMortgage is not defined" > onClick(click clientx=28, clientY=6) > > What do I need to add to my CalculateMortgage function near the bottom > to define it? > > (And what does "clientx=28, clientY=6" have to do with?) > > Thanks for the help, Jake! > > Rick > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ???? > Sent: Sunday, March 11, 2007 8:25 PM > To: jQuery Discussion. > Subject: Re: [jQuery] Need someone to help me understand my syntax error in > validation plug-in... > > you're missing the { before the function body! > > $().ready(function() > > // validate Mortgage_Calculation_Form form fields on keyup > $("#MC_Form").validate({ > > should be > > $().ready(function() > { //----- right here > // validate Mortgage_Calculation_Form form fields on keyup > $("#MC_Form").validate({ > > > On 3/11/07, Rick Faircloth <[EMAIL PROTECTED]> wrote: > > Hi, all... (and perhaps you're around, Jorn?) > > > > One of the things that confuses me most about JS > > is the bracketing that has to occur. > > > > Jorn, I've tried to place the submitHandler in my code > > and I don't know if I've done that correctly, but I do know > > that I'm getting an error in Firebug: > > > > "missing { before function body" > > $("#MC_Form").validate({\n > > > > Before I moved my code that was handling the mortgage calculation > > inside the validation code, I wasn't getting this error. > > > > I'm sure it's because I'm missing a bracket somewhere (as it says), > > but I'm not sure how to correct my code. > > > > Can someone review the code below for proper bracketing (or anything > > else you may notice) and tell me how to correct it? > > > > Thanks for the help! > > > > Rick > > > > <script type="text/javascript"> > > > > $.validator.defaults.debug = true; > > $().ready(function() > > > > // validate Mortgage_Calculation_Form form fields on keyup > > $("#MC_Form").validate({ > > > > errorPlacement: function(error, element) { > > > > if(element.attr('id') == "Principal") { > > error.appendTo("#principal_error"); > > } > > > > else > > > > if(element.attr('id') == "Interest") { > > error.appendTo("#interest_error"); > > } > > > > else > > > > if(element.attr('id') == "Years") { > > error.appendTo("#years_error"); > > } > > > > }, //closes errorPlacement function > > > > focusInvalid: "false", > > > > event: "keyup", > > > > rules: { > > Principal: {required: true, > > number: true}, > > Interest: {required: true, > > number: true}, > > Years: {required: true, > > number: true} > > }, > > > > messages: { > > Principal: {required: "Please enter the > > Principal.", > > number: "Please enter a number. > > Format: 255000 (No $ or , )"}, > > Interest: {required: "Please enter the > > Interest Rate.", > > number: "Please enter a number."}, > > Years: {required: "Please enter the Years.", > > number: "Please enter a number."} > > }, > > > > > > submitHandler: function(){ > > > > function CalculateMortgage(){ > > > > var Params = {}; > > > > // select all inputs of type text > > $("input:text").each(function(){ > > Params[$(this).attr("name")] = > > $(this).val(); > > }); // closes input:text function > > > > // "post" the form. The Param object mimics > > form fields > > $.post("Mortgage_Calculation.cfm", Params, > > function(data){ > > // this is the processing function. > > > > // append what you get back to the element > > with ID = Result after clearing its contents > > $("#Result").empty().append(data); > > > > } // closes post function > > ); // closes ( after .post > > } // closes input:text function > > > > } // closes the submitHandler function > > > > }) // closes the ) before the .validate bracket? > > }); // closes the .validate bracket > > > > </script> > > > > > > > > _______________________________________________ > > jQuery mailing list > > [email protected] > > http://jquery.com/discuss/ > > > > > -- > Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > > > > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > -- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/ _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
