jQuery: The Write Less, Do More JavaScript Library

jQuery form plugin?

View: New views
3 Messages — Rating Filter:   Alert me  

jQuery form plugin?

by Jim Byrnes-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am new to jQuery and really new to the form plugin so I must be
missing something simple but I can't figure out what is wrong.

I have this form:

<div class="print">
        <h3>Print Items Due Report</h3>
        <form id="printForm"  action="printRange.php" method="post">
        Date to Print<br />
                <input type="text" name="dueDateWest" id="dueDateWest" />
                <input type="submit" name="printItems" id="printItems" value="" />
        </form>

If I put this in the ready function: $('#printForm').ajaxForm();

Firebug shows show a response and post that seem correct, but
printRenge.php does not format a page to print.

If I put anything in front of #printForm like this:
$('XX#printForm).ajaxForm() firebug says "reload to activate window
console" and printRange.php formats a page.

Can anyone tell me what I am doing wrong?

Thanks,  Jim

Re: jQuery form plugin?

by malsup :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can you post a link to this page, or a similar example page?


On Nov 1, 6:00 pm, Jim Byrnes <jf_byr...@...> wrote:

> I am new to jQuery and really new to the form plugin so I must be
> missing something simple but I can't figure out what is wrong.
>
> I have this form:
>
> <div class="print">
>         <h3>Print Items Due Report</h3>
>         <form id="printForm"  action="printRange.php" method="post">
>         Date to Print<br />
>                 <input type="text" name="dueDateWest" id="dueDateWest" />
>                 <input type="submit" name="printItems" id="printItems"                                         value="" />
>         </form>
>
> If I put this in the ready function: $('#printForm').ajaxForm();
>
> Firebug shows show a response and post that seem correct, but
> printRenge.php does not format a page to print.
>
> If I put anything in front of #printForm like this:
> $('XX#printForm).ajaxForm() firebug says "reload to activate window
> console" and printRange.php formats a page.
>
> Can anyone tell me what I am doing wrong?
>
> Thanks,  Jim

Re: Re: jQuery form plugin?

by Jim Byrnes-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mike Alsup wrote:
> Can you post a link to this page, or a similar example page?

Unfortunately no.  It is an internal app that hooks to a MySQl database
on a web server I setup on my desktop.

I did put together a small test case that exhibits the same behavior.  I
am running jQuery 1.3.2 and the Malsup jQuery Form Plugin vers
2.33(22-Sep-2009).

<html>
<head>
<title>TEST</title>
<SCRIPT type="text/javascript" src="../../jquery/jquery.js"></SCRIPT>
<SCRIPT type="text/javascript" src="../../jquery/jquery.form.js"></SCRIPT>
<SCRIPT type="text/javascript" src="test.js"></SCRIPT>
</head>
<body>
<div class="print">
                <h3>Print Items Due Report</h3>
                <form id="printForm"  name="printForm" action="test.php" method="post">
                Date to Print<br />
                        <input type="text" name="dueDateWest" id="dueDateWest" />
                        <input type="submit" name="printItems" id="printItems" value="SUBMIT" />
                </form>
        </div>
</body>
</html>

// test.js
$(document).ready(
        function() {
                //$('x#printForm').ajaxForm();
                $('#printForm').ajaxForm();
        }
);

<?php
// test.php
print_r ($_REQUEST);
?>

Thanks,  Jim

>
> On Nov 1, 6:00 pm, Jim Byrnes <jf_byr...@...> wrote:
>> I am new to jQuery and really new to the form plugin so I must be
>> missing something simple but I can't figure out what is wrong.
>>
>> I have this form:
>>
>> <div class="print">
>>         <h3>Print Items Due Report</h3>
>>         <form id="printForm"  action="printRange.php" method="post">
>>         Date to Print<br />
>>                 <input type="text" name="dueDateWest" id="dueDateWest" />
>>                 <input type="submit" name="printItems" id="printItems"                                         value="" />
>>         </form>
>>
>> If I put this in the ready function: $('#printForm').ajaxForm();
>>
>> Firebug shows show a response and post that seem correct, but
>> printRenge.php does not format a page to print.
>>
>> If I put anything in front of #printForm like this:
>> $('XX#printForm).ajaxForm() firebug says "reload to activate window
>> console" and printRange.php formats a page.
>>
>> Can anyone tell me what I am doing wrong?
>>
>> Thanks,  Jim
>