On 16/03/07, Rick Faircloth <[EMAIL PROTECTED]> wrote:
> Hi, Sam, and thanks for the reply and code...
>
> I tried using your code, but still nothing happens
> when I try to calculate the payment.  It may be my
> implementation of the js or it still may be a problem
> in my ColdFusion code.
>
> Do I just stick your code in with my CalculateMortgage function
> "as is", or does it need anything else added... or a different position
> in the code?
>
> Here's where it lies now:
>
> Thanks!
>
> Rick
>
Probably best done within document.ready as otherwise you could get an
endless loop.

This doesn't fix any issues you may have with CalculateMortgage, it
just calls CalculateMortgage whenever you press enter when in a text
field.

If you have Firefox and use Firebug, you could try adding
console.log(Param) just before $.post and console.log(data) just
before $("#Result") to see if there are any errors.

>
>
> <script type="text/javascript">
>
>     // Define CalculateMortgage in the global scope so that it is always
> accessible
>
>         function CalculateMortgage(){
>
>             var Params = {};
>
>             $("input:text").each(function(){
>             Params[$(this).attr("name")] = $(this).val();
>             });
>
>             $.post("callpage_Validate_Mortgage_Inputs.cfm", Params,
> function(data){
>
>             $("#Result").empty().append(data);
>
>             } );
>         }
>
>
>         $("input:text").bind("keypress",function(e) {
>         var key = e.keyCode || e.charCode;
>         if(key == 13) {CalculateMortgage();
>                 }
>         }
> )
>
>
>
>         $(document).ready(function(){
>
>                 $("#Principal").blur(function(){
>                 $.post("callpage_Validate_Mortgage_Inputs.cfm",
> {principal:$("#Principal").val()},
>                 function (data) {$("#Result_Principal").empty().append(data)
> } ) });
>
>                 $("#Interest").blur(function(){
>                 $.post("callpage_Validate_Mortgage_Inputs.cfm",
> {interest:$("#Interest").val()},
>                 function (data) {$("#Result_Interest").empty().append(data)
> }) });
>
>                 $("#Years").blur(function(){
>
> $.post("callpage_Validate_Mortgage_Inputs.cfm",{years:$("#Years").val()},
>                 function (data) {$("#Result_Years").empty().append(data) })
> });
>
>         });
>
> </script>
>
>
>
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to