[jQuery] Re: simple jquery form plugin question

2009-11-26 Thread Kelly
Hi David,
I was able to recreate the same problem and fixed it. Try this:
html
head
titlejQuery Form Plugin/title
style type=text/css
form { background: #DFEFFC; border: 5px solid #c5dbec; margin: 10px 0;
padding: 20px }
/style
script type=text/javascript src=../jquery-latest.js/script
script type=text/javascript src=../jquery.form.js/script
script type=text/javascript

// wait for the DOM to be loaded
$(document).ready(function() {
// bind 'myForm' and provide a simple callback function
$('#myForm').ajaxForm(function() {
alert(Thank you for your comment!);
});
});

/script
/head
body
form method=post action=dummy.php id=myForm
  Name:input type=text value=MyName1 name=Name/
  input type=submit value=Submit1 name=submitButton/

/form
/body
/html

- replace action=http://jquery.malsup.com/form/dummy.php; with:
action=dummy.php  [just create a text file with dummy text in it,
name it 'dummy.php' and put in same directory as your test HTML file]
- remove the extra pair of script tags script type=text/
javascript  /script - you nested your script inside two pairs of
tags - just remove one pair.

Other than that, just make sure the path to your .js files is correct,
as Brian suggested.


Re: [jQuery] Re: simple jquery form plugin question

2009-11-26 Thread David
Thank you very much Kelly!
You solved my problem.

On Thu, Nov 26, 2009 at 12:59 AM, Kelly k...@njit.edu wrote:

 Hi David,
 I was able to recreate the same problem and fixed it. Try this:
 html
 head
 titlejQuery Form Plugin/title
 style type=text/css
 form { background: #DFEFFC; border: 5px solid #c5dbec; margin: 10px 0;
 padding: 20px }
 /style
 script type=text/javascript src=../jquery-latest.js/script
 script type=text/javascript src=../jquery.form.js/script
 script type=text/javascript

 // wait for the DOM to be loaded
$(document).ready(function() {
// bind 'myForm' and provide a simple callback function
$('#myForm').ajaxForm(function() {
alert(Thank you for your comment!);
});
});

 /script
 /head
 body
 form method=post action=dummy.php id=myForm
   Name:input type=text value=MyName1 name=Name/
  input type=submit value=Submit1 name=submitButton/

 /form
 /body
 /html

 - replace action=http://jquery.malsup.com/form/dummy.php; with:
 action=dummy.php  [just create a text file with dummy text in it,
 name it 'dummy.php' and put in same directory as your test HTML file]
 - remove the extra pair of script tags script type=text/
 javascript  /script - you nested your script inside two pairs of
 tags - just remove one pair.

 Other than that, just make sure the path to your .js files is correct,
 as Brian suggested.