[jQuery] Re: Jquery form plugin can't find resolution

2010-02-15 Thread Marty Jones
Instead of doing $(this).ajaxSubmit(options);

try

$('#formId').ajaxSubmit(options);

where #formId is the id of the form you are submitting.


On Feb 14, 8:58 am, NHARRY nha...@live.co.uk wrote:
 I have a form that is loaded using .load it is then posted using the
 jquery form plugin. But it won't post see code:

  script type=text/javascript
 $(document).ready(function() {
         //shows loading screen whilst posting via ajax
         $().ajaxStart($.blockUI).ajaxStop($.unblockUI);

         //post form add_customer ajax
         var options = {
         target: '#alert',
     };
            $('#add_customer').submit(function() {
                 $(this).ajaxSubmit(options);
                 return false;
             });

 //load form
 $('#theform').hide().load('form.php', function() {
 $(this).fadeIn();
  return false;

 });
 });

     /script

 I am sure there are others that have had this problem. Help ismuch
 appreciated.


[jQuery] Re: jQuery Form Plugin

2010-01-13 Thread Mike Alsup
Use Firebug to see what data is actually being posted to the server.


 in update_homepage.php i save data to mysqldb.

 But if i click to submit buton, i see in div id=odezva/div OK
 echo from update_homepage.php, but in db is only first (Nadpis) field
 of form. And (!!!) if i click to this button second time go to db also
 second field!
 If i close Javascript - all is right - the page is reloaded and all
 data are in db.

 Can you help me? I want ofcourse send all data of first click.
 Zhank you very much!


[jQuery] Re: jQuery form plugin and document.domain failure

2009-11-11 Thread Dave Methvin
.ajaxForm uses $.ajax, which uses XMLHttpRequest. There are some
issues with the way xhr interacts with document.domain, independent of
jQuery.

http://fettig.net/weblog/2005/11/28/how-to-make-xmlhttprequest-connections-to-another-server-in-your-domain/



[jQuery] Re: Jquery Form Plugin not sending name of button in Safari

2009-11-04 Thread petersendidit
Here is a patched version of the ajaxForm function that fixes the
problem.
$.fn.ajaxForm = function(options) {
return this.ajaxFormUnbind().bind('submit.form-plugin', function() {
$(this).ajaxSubmit(options);
return false;
}).bind('click.form-plugin', function(e) {
var $el = $(e.target);
var target = e.target;
if (!($el.is(:submit,input:image))) {
var $parent = $el.closest(:submit);
if ($parent.length)
target = $parent[0];
else
return;
}
var form = this;
form.clk = target;
if (target.type == 'image') {
if (e.offsetX != undefined) {
form.clk_x = e.offsetX;
form.clk_y = e.offsetY;
} else if (typeof $.fn.offset == 'function') { // try 
to use
dimensions plugin
var offset = $el.offset();
form.clk_x = e.pageX - offset.left;
form.clk_y = e.pageY - offset.top;
} else {
form.clk_x = e.pageX - target.offsetLeft;
form.clk_y = e.pageY - target.offsetTop;
}
}
// clear form vars
setTimeout(function() { form.clk = form.clk_x = form.clk_y =
null; }, 10);
});
};

On Nov 4, 8:44 am, petersendidit petersendi...@gmail.com wrote:
 I have a form with 2 button elements in it.  Button elements are used
 because they are much easier to style as needed.

 form id=testform  method=post name=testform
         input type=text value= name=firstname id=firstname/
         button class=button ci_btn_shdw value=Save As New  name=_event
 [aed_save] type=submitspanSave/span/button
         button class=button ci_btn_shdw value=Save As Copy  name=_event
 [aed_copy] type=submitspanSave As Copy/span/button
 /form

 I am using the jquery form plugin (http://jquery.malsup.com/form/) to
 submit the form by ajax.  Everything works great in all browsers
 except for Safari and Chrome.  The problem in Safari and Chrome is
 that the name of the button that was pressed does not get sent back.
 My guess is that the form plugin is getting confused by the span
 inside the button and not grabbing the name from the button element.
 Is there a way to fix this?


[jQuery] Re: jQuery form plugin?

2009-11-02 Thread Mike Alsup
Can you post a link to this page, or a similar example page?


On Nov 1, 6:00 pm, Jim Byrnes jf_byr...@comcast.net 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
         h3Print Items Due Report/h3
         form id=printForm  action=printRange.php method=post
         Date to Printbr /
                 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] Re: jQuery form plugin?

2009-11-02 Thread Jim Byrnes

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
titleTEST/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
h3Print Items Due Report/h3
form id=printForm  name=printForm action=test.php 
method=post
Date to Printbr /
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...@comcast.net 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
h3Print Items Due Report/h3
form id=printForm  action=printRange.php method=post
Date to Printbr /
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






[jQuery] Re: jQuery form plugin

2009-10-18 Thread factoringcompare.com

Can you post your full code so we can see?

On Oct 17, 11:46 pm, Boray Eris pidiz...@gmail.com wrote:
 http://www.pidizayn.com/virtualsub/jqform

 First form is ok. But second one that pulled with jquery not working.
 What's wrong?


[jQuery] Re: jquery form plugin upload problem

2009-09-12 Thread Mike Alsup

 I'm using the latest version of the jquery form plugin (from MAlsup) for
 file uploading. The upload works: the server call happens, the file data
 makes it there and the server returns a value, in this case just a
 number (as plain text). I've been unable to get that returned value to
 show up in the success function. Maybe someone knows what I'm missing.

Can you post a link?


[jQuery] Re: jquery form plugin upload problem

2009-09-12 Thread Jack Killpatrick
Thanks, Mike, it magically started working for me. I must have had 
something else cheesed ;-)


Appreciate your response, it seems to be working nicely now.

- Jack

Mike Alsup wrote:

I'm using the latest version of the jquery form plugin (from MAlsup) for
file uploading. The upload works: the server call happens, the file data
makes it there and the server returns a value, in this case just a
number (as plain text). I've been unable to get that returned value to
show up in the success function. Maybe someone knows what I'm missing.



Can you post a link?

  




[jQuery] Re: Jquery Form plugin : Multiselect problem

2009-09-11 Thread Mike Alsup

 I need to check all multiselect values before posting form.
 How i can do it?

 I'm trying to use beforeSubmit function, but changes that I do there
 doesn't applying to the formData.
 (Form plugin send information that was grabbed before beforeSubmit
 function).

Try 'beforeSerialize' instead of 'beforeSubmit'.  That fn is not
passed the form data because it is invoked prior to serialization
(obviously). But it gives you a chance to manipulate the DOM before
the values are retrieved.

Mike


[jQuery] Re: jQuery Form Plugin ajax submit

2009-08-26 Thread Mike Alsup

 Using the following code:

 $('.input_all').attr(disabled, disabled);

 for input texts with the class=input_all seems to break jQuery forms
 ajax submit.

 How can I fix this?


If you are expecting disabled inputs to be submitted then that is not
really broken - disabled inputs should *not* be submitted (per the
HTML spec).  If you really don't want to adhere to the spec and you
want all inputs to be submitted, regardless of whether or not they are
successful[1], then you can change line 423 of the plugin to this:

var v = $.fieldValue(el, false);

[1] http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2


[jQuery] Re: jQuery Form Plugin ajax submit

2009-08-26 Thread Jules

To protect the input fields, use readOnly instead of disabled and the
value will be included.

On Aug 21, 9:39 pm, Chris Hall sifuh...@gmail.com wrote:
 Using the following code:

 $('.input_all').attr(disabled, disabled);

 for input texts with the class=input_all seems to break jQuery forms
 ajax submit.

 How can I fix this?


[jQuery] Re: jquery form plugin. IE doesnt work

2009-08-23 Thread MorningZ

Well, here's your code from what i see

$('#submitForm').click(function() {
   if ($('#contactForm').valid()) {
   $('#loading').fadeIn(slow);
   $('#contactForm').ajaxForm(function(data) {
  ... more code
   });
   }
});

So, hopefully like you did, fired up IE8's console/debugger and saw
the break/error like you did...

to help diagnose the issue, use the non-compressed version of the
plugin code instead, that will give you a much better idea of what the
error is and consequently how to fix it

Also just a short suggestion:  increase your maxlength for the email
and subject on that form, they are set way too short



On Aug 22, 10:13 pm, markstegg...@googlemail.com
markstegg...@googlemail.com wrote:
 Hello,

 Im using ajaxForm to submit my contact form at futurekode.com:

 $('#contactForm').ajaxForm(function(data) {}

 --

 This works fine in all browsers except IE7/8. IE error says theres a
 problem with jquery 1.3.2 and highlights this line:

 returnsubmit===T.type

 Could someone take a look at my contact form in IE and see if there is
 a fix for this?

 Thanks
 Mark


[jQuery] Re: jquery form plugin. IE doesnt work

2009-08-23 Thread markstegg...@googlemail.com

Thanks for the good advice. I downloaded the development version of
jquery 1.3.2.

IE script debugger is highlighting line 1897

return submit === elem.type;

Surely there is nothing wrong with this?

 input id=submitForm type=submit value=Send title=Send your
message /



[jQuery] Re: jquery form plugin ajaxSubmit / fieldvalue inconsistent behaviour [jquery form]

2009-08-03 Thread Mike Alsup

 if you have in html the following:

 input type=checkbox value=true name=check/
 input type=hidden value=false name=check/

 ajaxSubmit will submit :

 check : true
 check : false

 $(#check).fieldValue() will return
 [ true ]

 so, this is inconsistent with the result of ajaxSubmit, it should
 return  [true,false]


What is #check?  Unless it's a select element you'll only have one
value for that element.  ajaxSubmit submits an entire form but your
call to fieldValue is asking for the value of a specific element.


[jQuery] Re: jquery form plugin ajaxSubmit / fieldvalue inconsistent behaviour [jquery form]

2009-08-03 Thread rekna



On Aug 3, 4:57 pm, Mike Alsup mal...@gmail.com wrote:
  if you have in html the following:

  input type=checkbox value=true name=check/
  input type=hidden value=false name=check/

  ajaxSubmit will submit :

  check : true
  check : false

  $(#check).fieldValue() will return
  [ true ]

thanks for the comment... i should probably use $
('[name=check]').fieldValue() instead of use the id...
still this results in ['on','false' ] when the checkbox is checked,
while ajaxSubmit posts check:true , check:false
  so, this is inconsistent with the result of ajaxSubmit, it should
  return  [true,false]

 What is #check?  Unless it's a select element you'll only have one
 value for that element.  ajaxSubmit submits an entire form but your
 call to fieldValue is asking for the value of a specific element.


[jQuery] Re: jQuery Form plugin with Yahoo UI

2009-07-17 Thread debussy007


The problem has been solved ... I forgot to close the script tag of the
plugin js inclusion ...




debussy007 wrote:
 
 Hi,
 
 When I add the jquery.form.js plugin from malsup, my Yahoo UI TreeView
 won't render anymore ...
 There seems to be some conflict.
 Is there any workaround for that ?
 
 Thank you for any help.
 

-- 
View this message in context: 
http://www.nabble.com/jQuery-Form-plugin-with-Yahoo-UI-tp24530556s27240p24533072.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: jquery form plugin and firebug conflict

2009-06-11 Thread Mike Alsup

    success:       processJson,  // post-submit callback


 function process(data){


Is the function processJson or process??


[jQuery] Re: jQuery Form Plugin with a submit button outside of the form

2009-06-10 Thread johnHoysa

Yes valid markup rocks! I never thought of moving my form elements
around like I did so I thought posting my temporary solution might be
helpful to some. As I said temporary solution is the key phrase there.

I was able to get one of my buttons working as needed but am having
issues with my other button that has a showRequest and showResponse
function associated with it. Below is the working code for my button
when the button is placed inside the form element. What I want to do
is move my submit button outside the form and have the form submitted
via a click action. I tried moving my submit button outside the form
and it still works just fine and dreamweaver is saying my code is
valid. Also this seems to work in IE 7, FF, Safari and Chrome on my
PC. If I was not working locally I would be more then happy enough to
post my code for additional help/comments.

My working code is below.

script
$(document).ready(function() {
var options = {
beforeSubmit:  showRequest,
success:   showResponse
}

$('#addNewTasks').ajaxForm(options);
});// end document ready


// pre-submitcallback
function showRequest(formData, jqForm, options) {
//alert('About to submit');
var formElement = jqForm[0];
return true;
}

// post-submitcallback
function showResponse(responseText, statusText)  {
//alert('Submitted and will now show up once 
this alert is
closed.');
$.get('includes/tasks.cfm',{},function(data){
 $('#newTasks').html(data);
 $('ul:last').fadeIn(slow);
})
}
/script

Any help with it would be great! Thanx in advance.

John


[jQuery] Re: jQuery Form Plugin with a submit button outside of the form

2009-06-09 Thread johnHoysa

You are able to span a form across a few divs. What I realized though
is that there must be an equel number of divs between the Form tags to
work properly

for example this will work

form
div random content /div
div my form elements to submit /div
div content /div
div content/div
submit button
/form

This will not work for me, and this is what I was trying to do from
the get go.


form
div random content /div
div my form elements to submit /div
div content /div
div content
submit button
/form
/div

Necmettin, thanx for the help!


[jQuery] Re: jQuery Form Plugin with a submit button outside of the form

2009-06-09 Thread Mike Alsup

 You are able to span a form across a few divs. What I realized though
 is that there must be an equel number of divs between the Form tags to
 work properly

Yeah, valid markup always helps.  :-)

http://validator.w3.org/


[jQuery] Re: jQuery Form Plugin with a submit button outside of the form

2009-06-08 Thread Necmettin Begiter

On Mon, Jun 8, 2009 at 18:10, johnHoysajohnho...@gmail.com wrote:

 I have my form working great as long as my submit button is contained
 within the form tags. But the design calls for the submit button to be
 outside of the form. Any suggestions?

Don't get me wrong, but that is not logical at all. By design,
[submit] must be inside form/.

 form
 my form here
 /form
 div /div
 div Submit button /div

Why not do
form
div/
div[submit]/div
/form
? What differs if you do this?

Try using basic Javascript, something like (fix and improve it of
course): button onclick=document.forms[0].submit();. Of course
you'll need to replace d.f.submit() with your working function to
ajax-submit the form if that's what you wish.


[jQuery] Re: jQuery Form Plugin with a submit button outside of the form

2009-06-08 Thread johnHoysa


 Why not do
 form
 div/
 div[submit]/div
 /form
 ? What differs if you do this?

If you move the form tag outside to an other div it just seems to stop
working unless in IE7.

I will try the button onclick like you suggested.

Thanx for the help.


[jQuery] Re: JQuery Form Plugin

2009-05-20 Thread Dez

Doh!

Of course as soon as I post that something occurs to me that hadn't
before. During a testing cycle a script tag for jquery was added to
the output from the form. I guess that reinitializes everything, which
makes sense. Pulled the tag from the output and everything is fine
again.

-Sean


[jQuery] Re: jQuery form plugin file upload failure

2009-04-28 Thread Jim

Ok, after large amounts of debugging and thinking things through, my
co-worker (who originally wrote the piece we're working on) noticed
that we close the modal dialog in which our form resides after we make
our call to submit.  This makes perfect sense because the modal is no
longer needed after the form submits, and once the form submit line
has completed, the data is away to the server leaving us no need for
anything in the modal.

That is until you use the form plugin on a form with a file input.
The fileUpload() function in that plugin moves some of the form
submission process into a setTimeout, causing it to happen
asynchronously.  So our submit line completes and our script moves on
and closes the modal--ripping the form out of the DOM.  THEN what the
plugin dropped into the setTimeout executes and guess what--there's
nothing left for it to work with.

To the plugin author: you should document this on your site in the
section about file uploads.  The move of a chunk of code into an
asynchronous place of execution has some implications which should be
brought to the attention of those working with your plugin.

Thanks,
Jim


On Apr 27, 9:09 pm, Jim auldrid...@gmail.com wrote:
 I'm using the latest version of the form plugin 
 fromhttp://jquery.malsup.com/form/
 and am having problems with a form that has an input of type file.

 I have read all the info about how to return JSON and such, how an
 iframe is used, etc.  I've Googled around and searched this list, but
 m not seeing anything relating to my problem.

 I have a series of forms which pop up in a modal dialog and are
 submitted view the ajaxSubmit method.  Only one of these forms has a
 file field in it, and it does not work at all.  Upon hitting submit, I
 see no network activity in the Firebug console, though I didn't really
 expect any given that this uses the iframe.   However, the Net panel
 of Firebug shows no activity either.  Further, the PHP file at which
 this form is pointed has a LOT of debug statements in it, and none of
 them show up in the logs when I it submit.

 I added some debugging to the ajax-on-error method I'd set for this
 call by adding a console.log() of the error text and the error object
 which are passed to the error function and they say

 error

 and

 SyntaxError  ()@:0\neval(\()\)@:0\n([object Object],\json\)
 @https://jauldridge.yakabod.net/js/vne/jquery/core/jquery.js:29\ncb(-5)
 @https://jauldridge.yakabod.net/js/vne/jquery/plugins/form/
 jquery.form.js:305\n

 respectively.    adding a consol.log() of the XHR object which is
 passed to the error function shows the mock object and it is still
 empty.

 Line 305 of the form plugin seems to be what is referenced in the odd
 output of the error object, along with line 29 of jQuery.  Line 305 of
 the form plugin is a call to jQuery's httpData method which is defined
 on line 29 of jQuery.  Line 305 of the form plugin is supposed to be
 taking what was retrieved from the textarea (I'm using JSON) of the
 iframe and passing it to jQuery with my specified data type for
 parsing.  Since this is all happening without any network activity,
 and the mock object shows it is empty including its responseText, I
 imagine that is why jQuery's httpData method is getting an error in
 trying to parse JSON.

 I just cannot figure this out, and I'd really like some help.  Why is
 the plugin acting like it is done submitting when it hasn't even tried
 to talk to the server?  This system is on a private network so I
 cannot link to it, but I will provide as much info as is asked for and
 I can obtain.

 Thanks,
 Jim


[jQuery] Re: jQuery Form Plugin Problem: IE7 gives Object doesn't support property or method

2009-04-13 Thread MeanStudios

Update:

I am using ExpressionEngine and am trying to edit to the publish area
(for those of you wondering) and I have no control over the name
attribute for the submit button and it's value is submit so I've
used jQuery to change the name of the submit button to something else
with this line of code:
$(input[name='submit']).attr('name', 'change_submit');

This works for FF, Safari and IE8 but it seems IE7 doesn't pick up
that change and still things the button is named submit.  I've used
the developer tool in the IE8 browser to check the DOM when it's
rendering in IE7 and it shows as 'change_submit' there so I'm not sure
what's up.

I've hacked the cp.publish.php file to manually change the submit
buttons name to something else and everything is working now.  So, the
problem is IE7 doesn't accept the button name change using jQuery.
Maybe if I remove that button and rebuild it?

On Apr 14, 8:23 am, MeanStudios cody.lundqu...@gmail.com wrote:
 Greetings,

 I'm using jQuery 1.3.2 and jQuery Form Plugin 2.25.
 My code:
         $('#msre_file').change(function(){
                 el = $(this);
                 target = el.next();
                 $('#entryform').ajaxSubmit({
                         url: '?php echo $cp_url; ?ms_rel_file=upload',
                         type: 'post',
                         iframe: true,
                         success: function(response) {
                                 el.attr('value', '');
                                 target.append('div class=msre_tmp_upload
 style=display:none;'+response+'/div');
                                 target.children('.msre_tmp_upload').fadeIn();
                         }
                 });
                 return false;
         });

 The form tag looks like:
 form action=index.php?C=editamp;M=new_entry name=entryform
 id=entryform method=post

 It works in FF2/3, Safari, IE8 but not in IE7.  I get an error on line
 257 which is:
 form.submit();

 I've changed that line to document.entryform.submit(); just for kicks
 and it still throws the error message.
 I've also done window.document.getElementById('entryform').submit();
 and it still doesn't work.
 I've done alert(document.entryform.msre_file.value); and it gives me
 the value of the file input correctly so I know it's referencing the
 form correctly.
 Yes I've changed the name attribute of the submit button to something
 other than submit.

 I've also scrapped the jQuery Form Plugin and wrote my own form submit
 function using the iframe method and it too worked in FF, Safari and
 IE8 but still threw the same error in IE7.

 I'm getting rather frustrated with this :(.

 Any help would be hugely appreciated.


[jQuery] Re: jQuery Form Plugin Problem: IE7 gives Object doesn't support property or method

2009-04-13 Thread MeanStudios

Second Update:

If you remove the name attribute from the button using jQuery then it
works. Just changing the name does not.

All fixed.

On Apr 14, 11:01 am, MeanStudios cody.lundqu...@gmail.com wrote:
 Update:

 I am using ExpressionEngine and am trying to edit to the publish area
 (for those of you wondering) and I have no control over the name
 attribute for the submit button and it's value is submit so I've
 used jQuery to change the name of the submit button to something else
 with this line of code:
 $(input[name='submit']).attr('name', 'change_submit');

 This works for FF, Safari and IE8 but it seems IE7 doesn't pick up
 that change and still things the button is named submit.  I've used
 the developer tool in the IE8 browser to check the DOM when it's
 rendering in IE7 and it shows as 'change_submit' there so I'm not sure
 what's up.

 I've hacked the cp.publish.php file to manually change the submit
 buttons name to something else and everything is working now.  So, the
 problem is IE7 doesn't accept the button name change using jQuery.
 Maybe if I remove that button and rebuild it?

 On Apr 14, 8:23 am, MeanStudios cody.lundqu...@gmail.com wrote:

  Greetings,

  I'm using jQuery 1.3.2 and jQuery Form Plugin 2.25.
  My code:
          $('#msre_file').change(function(){
                  el = $(this);
                  target = el.next();
                  $('#entryform').ajaxSubmit({
                          url: '?php echo $cp_url; ?ms_rel_file=upload',
                          type: 'post',
                          iframe: true,
                          success: function(response) {
                                  el.attr('value', '');
                                  target.append('div class=msre_tmp_upload
  style=display:none;'+response+'/div');
                                  
  target.children('.msre_tmp_upload').fadeIn();
                          }
                  });
                  return false;
          });

  The form tag looks like:
  form action=index.php?C=editamp;M=new_entry name=entryform
  id=entryform method=post

  It works in FF2/3, Safari, IE8 but not in IE7.  I get an error on line
  257 which is:
  form.submit();

  I've changed that line to document.entryform.submit(); just for kicks
  and it still throws the error message.
  I've also done window.document.getElementById('entryform').submit();
  and it still doesn't work.
  I've done alert(document.entryform.msre_file.value); and it gives me
  the value of the file input correctly so I know it's referencing the
  form correctly.
  Yes I've changed the name attribute of the submit button to something
  other than submit.

  I've also scrapped the jQuery Form Plugin and wrote my own form submit
  function using the iframe method and it too worked in FF, Safari and
  IE8 but still threw the same error in IE7.

  I'm getting rather frustrated with this :(.

  Any help would be hugely appreciated.


[jQuery] Re: jquery form plugin problem

2009-03-29 Thread dth

On 29 Mar., 02:46, Mike Alsup mal...@gmail.com wrote:
 Well there must be more to the story than what you're telling us.  The
 code you've shown above looks fine.  Perhaps there is a problem with
 the json response.

Actually that was excactly the problem. It would be good to get some
kind of notification though. Perhaps a javascript error in the browser
console or a failure function to complement the success one.

  Oh, and by the way. Is there any way to get access to the request in
  the 'success' function - to obtain status codes, content-type header
  etc.?

 No, not in the success function.  But you can use the 'complete'
 function to get access to the xhr.

 complete: function(xhr, status) {
   ...

 }

Cool, you should mention that on the website :)

Oh wait - this would kind of be the failure function mentioned
above. I actually get parsererror as statustext in the complete
function. Just didn't know about it :)

Thanks,

-dennis


[jQuery] Re: jquery form plugin problem

2009-03-29 Thread Mike Alsup

 Cool, you should mention that on the website :)

 Oh wait - this would kind of be the failure function mentioned
 above. I actually get parsererror as statustext in the complete
 function. Just didn't know about it :)

You can use all of the normal ajax options with the Form plugin.
success, complete, error, etc.  The form plugin uses $.ajax under the
hood and passes it any options you've provided.

http://docs.jquery.com/Ajax/jQuery.ajax#options

Mike


[jQuery] Re: jquery form plugin problem

2009-03-28 Thread Mike Alsup

 I'm trying to use the form plugin from malsup.org to submit a form
 with ajax, but it does not seem to work with options.

 This works:

                             $(#loginform).ajaxSubmit(function(obj,
 statusText) {
                                     alert(obj);
                             });

 This does not work (nothing happens):

                             $(#loginform).ajaxSubmit({
                                 dataType: json,
                                 success: function(obj, statusText) {
                                     alert(obj);
                                 }
                             });



Well there must be more to the story than what you're telling us.  The
code you've shown above looks fine.  Perhaps there is a problem with
the json response.



 Oh, and by the way. Is there any way to get access to the request in
 the 'success' function - to obtain status codes, content-type header
 etc.?


No, not in the success function.  But you can use the 'complete'
function to get access to the xhr.

complete: function(xhr, status) {
  ...
}


[jQuery] Re: jQuery Form plugin, the checkbox and the formData array

2009-03-23 Thread Mike Alsup

 The problem is that this CB function finds only checked checkboxes.

That's how forms are supposed to be submitted.  If you don't want this
behavior then you'll have to serialize the form yourself using
fieldSerialize.  For example:

$('#myForm').submit(function() {
var data = $(':input',this).fieldSerialize(false);
$.post(this.action, data);
return false;
});


[jQuery] Re: jQuery Form Plugin Ajax Problem

2009-03-05 Thread Mike Alsup

 I have a form and i submit it with:
 $(#form_ajax).ajaxSubmit();

 My problem is that some of the inputs are loaded on an action via
 ajax.

 When i submit the form the inputs which are loaded later are not
 submitted.

 Has anyone any idea?

 Thanks a lot!


If those inputs are added to the form they will be submitted.  Can you
post a link?


[jQuery] Re: jQuery Form Plugin ROOKIE in need of help :(

2009-02-26 Thread Brian Long

James, (and all)

Thanks a lot for the help - I'm now seeing all of  the things I want
in firebug.  I'm getting an XHR respose (is this the proper
terminology?  Is XHR always a request? regardless...)

I'm getting a response from my script which includes a script tag
(with functions) and an HTML form.  I now want to do something like
this (see the code below).

The main issue is this with the jquery form plugin, you can set a URL
to send the data to (via post, etc.) but the script never runs.  Can
you tell me how to process the response so that it will?  I do get the
HTML appended where I want it, but the script will not run.  Not even
my alert.

I've also tried using onsubmit of the form call my function, but
that doesn't seem to work either.  Do you know if that would work
normally?

Googling process XHR response or eval XHR response or eval(window);
all seem incorrect. I'm very bad at javascript and much more
comfortable with php -  PLEASE help if you can :-/



// This is essentially what's in my script

$('response_node').ready(function(){
alert('i ran');
var options = {
target:'#myForm',   // target element(s) to be updated 
with
server response
beforeSubmit:  showRequest,  // pre-submit callback
success:   showResponse,  // post-submit callback
// other available options:
url:   'voting.php',// override for form's 'action'
attribute

};
// If binding works, prevent default submit event
if( $('#myForm').ajaxForm(options)){
$('#myForm').submit(function(e){
e.preventDefault();
});

};

function showRequest(formData, jqForm, options) {
var queryString = $.param(formData);
console.log('inside showRequest of questionHandler using' +
queryString);
$('#output1').html('h6showRequest Called/h6');
return false;
}

// post-submit callback
function showResponse(responseText, statusText)  {
console.log('inside showResponse using'' + statusText +
'responseText:' + responseText);

$('#poll_div').html('h6showResponse Called/h6')
$('#poll_div').append(responseText);
}
});


// and my form is basically

form id='myForm' action='dont_run.php' method='post' class='vote' 
// stuff
/form



On Feb 25, 9:43 pm, James james.gp@gmail.com wrote:
 Yes, that's normal.

 On Feb 25, 1:55 pm, Brian Long brilon...@gmail.com wrote:

  Hey everybody - I'm definitely an amateur, but I have a pretty good
  understanding of PHP / MySQL / Firebug / FirePHP so I think we can
  work through this.

  If using the standard form plugin model - I have the callback:

  function showResponse(responseText, statusText)  {

      $('#myForm').html('h1Submission was successful/h1' +
  responseText);

  }

  I do see the HTML change in the browser / firebug for this element:
  form id=myForm

  but when I view source (in Firefox) --- I see the HTML that would of
  existed before the AJAX submission.

  Is this normal?

  Thanks in advance
  Brian Long




[jQuery] Re: jQuery Form Plugin ROOKIE in need of help :(

2009-02-26 Thread Brian Long

CLARIFYING:

I have two different URL's between my form's action and my url set in
the options that are sent to $('#myForm').ajaxForm(options)

I did that just because in earlier testing I was trying to confirm
that the URL used in my options variable would actually override the
value that was set in the action of the form

THANKS so much to the group for all past and future help!


On Feb 26, 10:42 am, Brian Long brilon...@gmail.com wrote:
 James, (and all)

 Thanks a lot for the help - I'm now seeing all of  the things I want
 in firebug.  I'm getting an XHR respose (is this the proper
 terminology?  Is XHR always a request? regardless...)

 I'm getting a response from my script which includes a script tag
 (with functions) and an HTML form.  I now want to do something like
 this (see the code below).

 The main issue is this with the jquery form plugin, you can set a URL
 to send the data to (via post, etc.) but the script never runs.  Can
 you tell me how to process the response so that it will?  I do get the
 HTML appended where I want it, but the script will not run.  Not even
 my alert.

 I've also tried using onsubmit of the form call my function, but
 that doesn't seem to work either.  Do you know if that would work
 normally?

 Googling process XHR response or eval XHR response or eval(window);
 all seem incorrect. I'm very bad at javascript and much more
 comfortable with php -  PLEASE help if you can :-/

 // This is essentially what's in my script

 $('response_node').ready(function(){
         alert('i ran');
         var options = {
                 target:        '#myForm',   // target element(s) to be 
 updated with
 server response
                 beforeSubmit:  showRequest,  // pre-submit callback
                 success:       showResponse,  // post-submit callback
                 // other available options:
                 url:       'voting.php',        // override for form's 
 'action'
 attribute

         };
         // If binding works, prevent default submit event
         if( $('#myForm').ajaxForm(options)){
                 $('#myForm').submit(function(e){
                         e.preventDefault();
                 });

         };

         function showRequest(formData, jqForm, options) {
                 var queryString = $.param(formData);
                 console.log('inside showRequest of questionHandler using' +
 queryString);
                 $('#output1').html('h6showRequest Called/h6');
                 return false;
         }

         // post-submit callback
         function showResponse(responseText, statusText)  {
                 console.log('inside showResponse using'' + statusText +
 'responseText:' + responseText);

                 $('#poll_div').html('h6showResponse Called/h6')
                 $('#poll_div').append(responseText);
         }

 });

 // and my form is basically

 form id='myForm' action='dont_run.php' method='post' class='vote' 
 // stuff
 /form

 On Feb 25, 9:43 pm, James james.gp@gmail.com wrote:

  Yes, that's normal.

  On Feb 25, 1:55 pm, Brian Long brilon...@gmail.com wrote:

   Hey everybody - I'm definitely an amateur, but I have a pretty good
   understanding of PHP / MySQL / Firebug / FirePHP so I think we can
   work through this.

   If using the standard form plugin model - I have the callback:

   function showResponse(responseText, statusText)  {

       $('#myForm').html('h1Submission was successful/h1' +
   responseText);

   }

   I do see the HTML change in the browser / firebug for this element:
   form id=myForm

   but when I view source (in Firefox) --- I see the HTML that would of
   existed before the AJAX submission.

   Is this normal?

   Thanks in advance
   Brian Long




[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread antcj...@gmail.com

Hi Thanks for replying back.

showRequest doesnt do anything. It just print the returned data.

Hey one more thing I noted, this plugin works fine with IE but not
Mozilla :(

Any workaround??

Thanks

On Feb 24, 4:45 am, Mike Alsup mal...@gmail.com wrote:
  I am getting the output xml from the php in the same window.
  It never goes inside showResponse function.

   I donot want this page redirection to happen :(
  Instead I want to handle the returned xml (or any data) in jquery
  itself.

 What does showRequest do?  Can you post a link?


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread Mike Alsup

 showRequest doesnt do anything. It just print the returned data.

 Hey one more thing I noted, this plugin works fine with IE but not
 Mozilla :(

 Any workaround??

I'm afraid you haven't provided enough information.  The plugin works
fine with both FF and IE so there is something more to the story on
your end.

Mike


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread antcj...@gmail.com

Hi Mike,

Thanks a lot for your reply..

This is what I did exactly

I just downloaded jquery.form.js from http://malsup.com/jquery/form/#download


The following code works fine in IE (The returned XML from server is
displayed through alert() )
But when I use the same code in Mozilla 3.0.6, It fails. ( I am
getting redirected
to the sell.php5 page )

Can anyone help me please?

Thanks,
Antony Johnson


And here is what I wrote
-
head
   script type=text/javascript src=jquery.js/script
   script type=text/javascript src=form.js/script
script type=text/javascript

function processXml(responseXML) {

   var message = $('message', responseXML).text();
   alert(message);
}


   $(document).ready(function() {

 var options = {

   success:   processXml  // post-submit callback

   };

   $('#htmlForm').submit(function() {

   $(this).ajaxSubmit(options);

   alert('Sending...');

   return false;
   });

   });


/script
/head

body

form id=htmlForm action=http://www.odibab.com/ostore/sell.php5;
method=post
   Message: input type=text name=message value=Hello HTML /
   input type=submit value=Echo as HTML /
/form

div id=output2 /div
/body
/html

?php
// !!! IMPORTANT !!! - the server must set the content type to XML
header('Content-type: text/xml');
echo 'rootmessage' . $_POST['message'] . '/message/root';
?
-






On Feb 25, 11:53 pm, Mike Alsup mal...@gmail.com wrote:
  showRequest doesnt do anything. It just print the returned data.

  Hey one more thing I noted, this plugin works fine with IE but not
  Mozilla :(

  Any workaround??

 I'm afraid you haven't provided enough information.  The plugin works
 fine with both FF and IE so there is something more to the story on
 your end.

 Mike


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread MorningZ

Chances are VERY likely that your function showResponse is throwing
an error in JavaScript, making the rest of the script stop running,
and as a result allowing the page/browser to make a normal, page
changing, post

comment out all the code in said function, or wrap it in a
try...catch  to see if you can figure out what is happening



On Feb 25, 1:53 pm, Mike Alsup mal...@gmail.com wrote:
  showRequest doesnt do anything. It just print the returned data.

  Hey one more thing I noted, this plugin works fine with IE but not
  Mozilla :(

  Any workaround??

 I'm afraid you haven't provided enough information.  The plugin works
 fine with both FF and IE so there is something more to the story on
 your end.

 Mike


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread antcj...@gmail.com

Hi ,

As you said I put the try catch.. Again, I dint even see the alert
msg :(  It redirected the page
to sell.php5

I am once again pasting the exactl code I have for your kind notice.
--
html

head
   script type=text/javascript src=jquery.js/script
   script type=text/javascript src=form.js/script
   script type=text/javascript

function processXml(responseXML) {

 try {
var message = $('message', responseXML).text();
alert(message);
   } catch(err)
  {
  txt=There was an error on this page.\n\n;
  txt+=Error description:  + err.description + \n\n;
  txt+=Click OK to continue.\n\n;
  alert(txt);
  }
}


  $(document).ready(function() {

  var options = {

url: 'http://www.odibab.com/ostore/sell.php5',
dataType:  'xml',
success:   processXml  // post-submit callback

};

$('#htmlForm').submit(function() {

$(this).ajaxSubmit(options);


//alert('john');

return false;
});


});


/script
/head

body

form id=htmlForm action=http://www.odibab.com/ostore/sell.php5;
method=post
Message: input type=text name=message value=Hello HTML /
input type=submit value=Echo as HTML /
/form

div id=output2 /div
/body
/html
--


On Feb 26, 12:10 am, MorningZ morni...@gmail.com wrote:
 Chances are VERY likely that your function showResponse is throwing
 an error in JavaScript, making the rest of the script stop running,
 and as a result allowing the page/browser to make a normal, page
 changing, post

 comment out all the code in said function, or wrap it in a
 try...catch  to see if you can figure out what is happening

 On Feb 25, 1:53 pm, Mike Alsup mal...@gmail.com wrote:

   showRequest doesnt do anything. It just print the returned data.

   Hey one more thing I noted, this plugin works fine with IE but not
   Mozilla :(

   Any workaround??

  I'm afraid you haven't provided enough information.  The plugin works
  fine with both FF and IE so there is something more to the story on
  your end.

  Mike


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread antcj...@gmail.com

Hey,.. The problem seems weird..

The same page which worked well in IE is not working when I put
the file into my server odibab.com and opened the page from IE.

So, If i keep the same html page in my local windows and use It works
But not when It is coming from odibab.com server.

Any idea why this happening?

Thanks in advance,
Antony Johnson




On Feb 26, 12:10 am, MorningZ morni...@gmail.com wrote:
 Chances are VERY likely that your function showResponse is throwing
 an error in JavaScript, making the rest of the script stop running,
 and as a result allowing the page/browser to make a normal, page
 changing, post

 comment out all the code in said function, or wrap it in a
 try...catch  to see if you can figure out what is happening

 On Feb 25, 1:53 pm, Mike Alsup mal...@gmail.com wrote:

   showRequest doesnt do anything. It just print the returned data.

   Hey one more thing I noted, this plugin works fine with IE but not
   Mozilla :(

   Any workaround??

  I'm afraid you haven't provided enough information.  The plugin works
  fine with both FF and IE so there is something more to the story on
  your end.

  Mike


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread Eric Garside

In Firefox, open up the Error Console, clear it, then try submitting
the form and see if an error is getting tossed that way.

Another option, is calling preventDefault(); on the event BEFORE your
processing code, so the form won't post, even if an error/exception is
thrown.

$('#myForm').submit(function(evt){
   evt.preventDefault();
   // Other code here
});



On Feb 25, 3:14 pm, antcj...@gmail.com antcj...@gmail.com wrote:
 Hey,.. The problem seems weird..

 The same page which worked well in IE is not working when I put
 the file into my server odibab.com and opened the page from IE.

 So, If i keep the same html page in my local windows and use It works
 But not when It is coming from odibab.com server.

 Any idea why this happening?

 Thanks in advance,
 Antony Johnson

 On Feb 26, 12:10 am, MorningZ morni...@gmail.com wrote:

  Chances are VERY likely that your function showResponse is throwing
  an error in JavaScript, making the rest of the script stop running,
  and as a result allowing the page/browser to make a normal, page
  changing, post

  comment out all the code in said function, or wrap it in a
  try...catch  to see if you can figure out what is happening

  On Feb 25, 1:53 pm, Mike Alsup mal...@gmail.com wrote:

showRequest doesnt do anything. It just print the returned data.

Hey one more thing I noted, this plugin works fine with IE but not
Mozilla :(

Any workaround??

   I'm afraid you haven't provided enough information.  The plugin works
   fine with both FF and IE so there is something more to the story on
   your end.

   Mike


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread antcj...@gmail.com

Hi Eric,

Thanks for helping me..

I did what you said, I got these two exceptions in the Mozilla Error
console.

Error: uncaught exception: [Exception... Illegal document.domain
value  code: 1009 nsresult: 0x805303f1
(NS_ERROR_DOM_BAD_DOCUMENT_DOMAIN)  location: http://odibab.com/
ostore/test.html Line: 49]

Error: [Exception... Access to restricted URI denied  code: 1012
nsresult: 0x805303f4 (NS_ERROR_DOM_BAD_URI)  location: http://
www.odibab.com/ostore/jquery.js Line: 2700]
Source File: http://www.odibab.com/ostore/jquery.js
Line: 2700

I dont know why the URI is in restricted? :(

Thanks,
Antony Johnson



On Feb 26, 1:49 am, Eric Garside gars...@gmail.com wrote:
 In Firefox, open up the Error Console, clear it, then try submitting
 the form and see if an error is getting tossed that way.

 Another option, is calling preventDefault(); on the event BEFORE your
 processing code, so the form won't post, even if an error/exception is
 thrown.

 $('#myForm').submit(function(evt){
    evt.preventDefault();
    // Other code here

 });

 On Feb 25, 3:14 pm, antcj...@gmail.com antcj...@gmail.com wrote:

  Hey,.. The problem seems weird..

  The same page which worked well in IE is not working when I put
  the file into my server odibab.com and opened the page from IE.

  So, If i keep the same html page in my local windows and use It works
  But not when It is coming from odibab.com server.

  Any idea why this happening?

  Thanks in advance,
  Antony Johnson

  On Feb 26, 12:10 am, MorningZ morni...@gmail.com wrote:

   Chances are VERY likely that your function showResponse is throwing
   an error in JavaScript, making the rest of the script stop running,
   and as a result allowing the page/browser to make a normal, page
   changing, post

   comment out all the code in said function, or wrap it in a
   try...catch  to see if you can figure out what is happening

   On Feb 25, 1:53 pm, Mike Alsup mal...@gmail.com wrote:

 showRequest doesnt do anything. It just print the returned data.

 Hey one more thing I noted, this plugin works fine with IE but not
 Mozilla :(

 Any workaround??

I'm afraid you haven't provided enough information.  The plugin works
fine with both FF and IE so there is something more to the story on
your end.

Mike


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread Eric Garside

You can only make ajax calls from within the same domain.

So if you're on http://www.something.com/ you CANNOT make an ajax
request to, say, http://www.otherdomain.com/

This is a security feature to prevent cross site scripting. It's not
enforced if you're running off the localhost iirc, but as soon as you
put it on a website with a fully qualified domain name, it starts to
throw a fit if you're attempting to request data from outside your
domain.

On Feb 25, 4:12 pm, antcj...@gmail.com antcj...@gmail.com wrote:
 Hi Eric,

 Thanks for helping me..

 I did what you said, I got these two exceptions in the Mozilla Error
 console.

 Error: uncaught exception: [Exception... Illegal document.domain
 value  code: 1009 nsresult: 0x805303f1
 (NS_ERROR_DOM_BAD_DOCUMENT_DOMAIN)  location: http://odibab.com/
 ostore/test.html Line: 49]

 Error: [Exception... Access to restricted URI denied  code: 1012
 nsresult: 0x805303f4 (NS_ERROR_DOM_BAD_URI)  location: 
 http://www.odibab.com/ostore/jquery.jsLine: 2700]
 Source File:http://www.odibab.com/ostore/jquery.js
 Line: 2700

 I dont know why the URI is in restricted? :(

 Thanks,
 Antony Johnson

 On Feb 26, 1:49 am, Eric Garside gars...@gmail.com wrote:

  In Firefox, open up the Error Console, clear it, then try submitting
  the form and see if an error is getting tossed that way.

  Another option, is calling preventDefault(); on the event BEFORE your
  processing code, so the form won't post, even if an error/exception is
  thrown.

  $('#myForm').submit(function(evt){
     evt.preventDefault();
     // Other code here

  });

  On Feb 25, 3:14 pm, antcj...@gmail.com antcj...@gmail.com wrote:

   Hey,.. The problem seems weird..

   The same page which worked well in IE is not working when I put
   the file into my server odibab.com and opened the page from IE.

   So, If i keep the same html page in my local windows and use It works
   But not when It is coming from odibab.com server.

   Any idea why this happening?

   Thanks in advance,
   Antony Johnson

   On Feb 26, 12:10 am, MorningZ morni...@gmail.com wrote:

Chances are VERY likely that your function showResponse is throwing
an error in JavaScript, making the rest of the script stop running,
and as a result allowing the page/browser to make a normal, page
changing, post

comment out all the code in said function, or wrap it in a
try...catch  to see if you can figure out what is happening

On Feb 25, 1:53 pm, Mike Alsup mal...@gmail.com wrote:

  showRequest doesnt do anything. It just print the returned data.

  Hey one more thing I noted, this plugin works fine with IE but not
  Mozilla :(

  Any workaround??

 I'm afraid you haven't provided enough information.  The plugin works
 fine with both FF and IE so there is something more to the story on
 your end.

 Mike


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread antcj...@gmail.com

Hey Eric,

My problem is solved!!!

Thanks a million :)

it's caused because I was loading the file into Firefox locally. If I
upload it to our server and run it, it works fine.

this was bcoz of some cross domain access policy in mozilla. I just
found it after seeing the error console msg.

Now all my referece (including .js and .php5) are to the same server.
Hence it works fine :) :)

Thanks a lot again..




On Feb 26, 1:49 am, Eric Garside gars...@gmail.com wrote:
 In Firefox, open up the Error Console, clear it, then try submitting
 the form and see if an error is getting tossed that way.

 Another option, is calling preventDefault(); on the event BEFORE your
 processing code, so the form won't post, even if an error/exception is
 thrown.

 $('#myForm').submit(function(evt){
    evt.preventDefault();
    // Other code here

 });

 On Feb 25, 3:14 pm, antcj...@gmail.com antcj...@gmail.com wrote:

  Hey,.. The problem seems weird..

  The same page which worked well in IE is not working when I put
  the file into my server odibab.com and opened the page from IE.

  So, If i keep the same html page in my local windows and use It works
  But not when It is coming from odibab.com server.

  Any idea why this happening?

  Thanks in advance,
  Antony Johnson

  On Feb 26, 12:10 am, MorningZ morni...@gmail.com wrote:

   Chances are VERY likely that your function showResponse is throwing
   an error in JavaScript, making the rest of the script stop running,
   and as a result allowing the page/browser to make a normal, page
   changing, post

   comment out all the code in said function, or wrap it in a
   try...catch  to see if you can figure out what is happening

   On Feb 25, 1:53 pm, Mike Alsup mal...@gmail.com wrote:

 showRequest doesnt do anything. It just print the returned data.

 Hey one more thing I noted, this plugin works fine with IE but not
 Mozilla :(

 Any workaround??

I'm afraid you haven't provided enough information.  The plugin works
fine with both FF and IE so there is something more to the story on
your end.

Mike


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-25 Thread Mike Alsup

 it's caused because I was loading the file into Firefox locally. If I
 upload it to our server and run it, it works fine.

 this was bcoz of some cross domain access policy in mozilla. I just
 found it after seeing the error console msg.

I'm glad you found the problem!  As a side note, this is why I always
ask people to post a link.  There is no way for us to know that you're
running stuff off the local file system.  By setting up a link you, or
someone else on the list, would have discovered the problem much
sooner.

Mike


[jQuery] Re: jQuery Form Plugin ROOKIE in need of help :(

2009-02-25 Thread James

Yes, that's normal.

On Feb 25, 1:55 pm, Brian Long brilon...@gmail.com wrote:
 Hey everybody - I'm definitely an amateur, but I have a pretty good
 understanding of PHP / MySQL / Firebug / FirePHP so I think we can
 work through this.

 If using the standard form plugin model - I have the callback:

 function showResponse(responseText, statusText)  {

     $('#myForm').html('h1Submission was successful/h1' +
 responseText);

 }

 I do see the HTML change in the browser / firebug for this element:
 form id=myForm

 but when I view source (in Firefox) --- I see the HTML that would of
 existed before the AJAX submission.

 Is this normal?

 Thanks in advance
 Brian Long


[jQuery] Re: jQuery Form Plugin redirects even if I use return false in $('#myForm2').submit(function()

2009-02-23 Thread Mike Alsup

 I am getting the output xml from the php in the same window.
 It never goes inside showResponse function.

  I donot want this page redirection to happen :(
 Instead I want to handle the returned xml (or any data) in jquery
 itself.


What does showRequest do?  Can you post a link?


[jQuery] Re: Jquery Form Plugin issues

2009-02-19 Thread Glenn

Daniel and all,
I am also seeing this same behavior.  I'm using FF 3.0.6.
I have tried various arrangements of the code using all the examples
from the plugin's webpage, but it always submits via non-AJAX.  Also,
if I try to use an options param to ajaxForm rather than a function
callback, it will oddly enough trigger the beforeSubmit and
success callbacks of the options immediately upon loading the page.
Here's my code (with the options param variation):
http://pastie.org/393825

-Glenn


[jQuery] Re: Jquery Form Plugin issues

2009-02-19 Thread Glenn

Nevermind my second point in my last post.  I see why it was calling
those callbacks immediately.  duh.  I had parentheses after their
names in the options hash!
Anyways, I do still have the main problem of not submitting via AJAX.


[jQuery] Re: Jquery Form Plugin issues

2009-02-19 Thread Mike Alsup

 I am also seeing this same behavior.  I'm using FF 3.0.6.
 I have tried various arrangements of the code using all the examples
 from the plugin's webpage, but it always submits via non-AJAX.

Seems to work ok for me:

http://www.malsup.com/jquery/form/testing/feb19.html

Are you including the form plugin script?  Does Firebug report any
errors?


[jQuery] Re: jQuery Form Plugin

2009-02-19 Thread Mike Alsup

 right direction, basically on submit, rather than redirecting to the
 default success (or error page), I just wanted this message to appear
 in the alert.

     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

 form id=myForm action=FormMail.pl method=POST
 input type=hidden name=recipient value=xxx /
 input type=hidden name=ar_subject value=Contact Form /
 input type=hidden name=require value=realname,email /
 input type=text class=textbox name=realname /
 input type=text class=textbox name=email /
 input type=submit class=submit value=CONTACT
 /form

 Thanks in advance!

I don't see anything wrong there execpt an extra  in the email
input.  Have you included the form plugin on your page?  What you
posted works here:

http://www.malsup.com/jquery/form/testing/feb19-2.php


[jQuery] Re: Jquery Form Plugin issues

2009-02-19 Thread Glenn

Weird.  Could it be that you are have the $(document).ready call in
the head?  I currently don't have it set up this way.  But I thought
from looking at other examples that it didn't matter.

On Feb 19, 12:29 pm, Mike Alsup mal...@gmail.com wrote:
  I am also seeing this same behavior.  I'm using FF 3.0.6.
  I have tried various arrangements of the code using all the examples
  from the plugin's webpage, but it always submits via non-AJAX.

 Seems to work ok for me:

 http://www.malsup.com/jquery/form/testing/feb19.html

 Are you including the form plugin script?  Does Firebug report any
 errors?


[jQuery] Re: Jquery Form Plugin issues

2009-02-19 Thread Glenn

Hammering this home, I also tried to point my form to your test.php
page, but still no change.  I do see your response, but it moves the
browser forward to a new page to display it.  I also have the exact
same versions of jquery and jquery form plugin.  Is there some other
setting somewhere on our server that may be forcing ajax calls to be
disabled?   This is driving me bonkers.


[jQuery] Re: Jquery Form Plugin issues

2009-02-19 Thread Glenn

Ok, I think the problem is related to using XMLHttpRequest in a cross-
site situation (which I was, since my API is a different domain than
my HTML).  I will resolve this using jsonp, or some other method.
Sorry for the trouble.  Hope this helps others.


[jQuery] Re: Jquery Form Plugin issues

2009-02-18 Thread Mike Alsup

 Everything has been checked for validation and so on. Doesn't work in
 IE or FF. Thanks in advance!

 script type=text/javascript
 $(document).ready(function() {
         var submitoptions = {
         target:        '#loading'
                 };

         $('#e2').submit(function(){
                 $(this).ajaxSubmit(submitoptions);
             return false;
         });});

 /script

 form id=e2 enctype=multipart/form-data class=photoform
 action=photo_process.php method=post
 labelPhoto # 2/labelbr/
 input type=file name=photo/
 input type=submit name=upload value=Upload style=width:100px;/

 /form

The code looks fine, aside from a missing  char in your submit
input.  Can you explain what is not working?  Is it not posting?  Not
processing the response?

Mike


[jQuery] Re: Jquery Form Plugin issues

2009-02-18 Thread Daniel

It is posting, but its not ajax posting. I've tried with and without
other inputs, and it still submits like a normal form. I'm losing my
mind over this one! Thanks for the quick response, Mike. Love the
plugin, and have used it more than once!

On Feb 18, 5:26 pm, Mike Alsup mal...@gmail.com wrote:
  Everything has been checked for validation and so on. Doesn't work in
  IE or FF. Thanks in advance!

  script type=text/javascript
  $(document).ready(function() {
          var submitoptions = {
          target:        '#loading'
                  };

          $('#e2').submit(function(){
                  $(this).ajaxSubmit(submitoptions);
              return false;
          });});

  /script

  form id=e2 enctype=multipart/form-data class=photoform
  action=photo_process.php method=post
  labelPhoto # 2/labelbr/
  input type=file name=photo/
  input type=submit name=upload value=Upload style=width:100px;/

  /form

 The code looks fine, aside from a missing  char in your submit
 input.  Can you explain what is not working?  Is it not posting?  Not
 processing the response?

 Mike


[jQuery] Re: Jquery Form Plugin issues

2009-02-18 Thread Mike Alsup

 It is posting, but its not ajax posting. I've tried with and without
 other inputs, and it still submits like a normal form. I'm losing my
 mind over this one! Thanks for the quick response, Mike. Love the
 plugin, and have used it more than once!


Daniel, can you post a link that shows the code in action?  When the
form submits normally it almost always means there is a script error
occurring.  Can't see why based on what you posted, but there's always
a reason!  :-)


[jQuery] Re: jQuery Form Plugin - success callback function isn't called

2009-01-22 Thread Redzzzzz


Hello, 

Topic is somewhat old, but I'm stuck on the same thing.. 'success' isn't
called 

I've managed to narrow it down somewhat on:
http://www.manneke.com/ajaxform/test.php

The first form is to an external php file that echoes 'hello' afterwhich
success IS NOT called. 

The second form is to a php file on the same server that also echoes 'hello'
afterwhich success IS called. 

The only apperant difference is the fact that the receiving php file is on
my local server and the other post is to an external php file.. 

Some help would really be appreciated 

malsup wrote:
 
 
 Actually if you put a debugger;  statement there and debug with
 firebug you will see that it actually gets called. But for some reason
 the alert does not work. But other js code will work so you can show
 your messages somewhere else on the page if you want or need to.
 
 Post a link so we can see it in action.
 
 

-- 
View this message in context: 
http://www.nabble.com/jQuery-Form-Plugin---%22success%22-callback-function-isn%27t-called-tp20130127s27240p21604545.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: jQuery Form Plugin - success callback function isn't called

2009-01-22 Thread Mike Alsup

 Topic is somewhat old, but I'm stuck on the same thing.. 'success' isn't
 called

 I've managed to narrow it down somewhat 
 on:http://www.manneke.com/ajaxform/test.php

 The first form is to an external php file that echoes 'hello' afterwhich
 success IS NOT called.

 The second form is to a php file on the same server that also echoes 'hello'
 afterwhich success IS called.

 The only apperant difference is the fact that the receiving php file is on
 my local server and the other post is to an external php file..


That is x-domain browser security kicking in.


[jQuery] Re: jQuery Form Plugin - success callback function isn't called

2009-01-22 Thread Sander Manneke | Internet Today

Right, didn't think of that.

I think I'll tackle that using Yahoo's suggested solution
http://developer.yahoo.com/javascript/samples/proxy/php_proxy_simple.txt

Thanks..



-Oorspronkelijk bericht-
Van: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] Namens
Mike Alsup
Verzonden: donderdag 22 januari 2009 15:11
Aan: jQuery (English)
Onderwerp: [jQuery] Re: jQuery Form Plugin - success callback function
isn't called


 Topic is somewhat old, but I'm stuck on the same thing.. 'success' isn't
 called

 I've managed to narrow it down somewhat
on:http://www.manneke.com/ajaxform/test.php

 The first form is to an external php file that echoes 'hello' afterwhich
 success IS NOT called.

 The second form is to a php file on the same server that also echoes
'hello'
 afterwhich success IS called.

 The only apperant difference is the fact that the receiving php file is on
 my local server and the other post is to an external php file..


That is x-domain browser security kicking in.

No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.176 / Virus Database: 270.10.12/1908 - Release Date: 21-1-2009
21:15



[jQuery] Re: jQuery Form Plugin - after ajaxSubmit call, ajax submitting seems to be disabled

2009-01-13 Thread Isaac Raway




malsup wrote:
 
 Sorry, I read your first message too quickly.  Is 'edit_card_jq' bound
 as a submit handler?  If so, you should return false form that fn.  If
 not, could you post a little more code or provide a link?
 

Here's a link that shows what I'm doing: http://blueapples.org/test/forms/

I figured out what my problem was however. I was trying to call ajaxForm
like this:

$('#edit_card form').ajaxSubmit('#edit_card', function() {
alert('Loaded');
edit_card_jq();
});

Instead of the proper way using an options dictionary:

$('#edit_card form').ajaxSubmit({
target: '#edit_card',
success: function() {
alert('Loaded');
edit_card_jq();
}
});

My mistake but I sure with Javascript would have complained about it. Oh
well, figured it out! Sorry to waste your time.
-- 
View this message in context: 
http://www.nabble.com/jQuery-Form-Plugin---after-ajaxSubmit-call%2C-ajax-submitting-seems-to-be-disabled-tp21424793s27240p21437053.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: jQuery Form Plugin - after ajaxSubmit call, ajax submitting seems to be disabled

2009-01-12 Thread Mike Alsup

 After submitting the form, successfully, the backend responds with a blank
 HTML form. This loads correctly after the call to ajaxSubmit. However when I
 submit the form a second time (to add an additional item) the submit is not
 sent through ajax, although my button handler which calls ajaxSubmit IS
 being fired (added an alert to the beginning to confirm this). The form is
 instead submitted as a regular POST form, replacing the entire page.

 Any ideas why this would happen?

This is why:

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F


[jQuery] Re: jQuery Form Plugin - after ajaxSubmit call, ajax submitting seems to be disabled

2009-01-12 Thread Isaac Raway


My handler - as shown previously - rebinds events when the submit succeeds. I
confirmed this, as stated in my message by adding an alert that is shown the
next time I click the submit button, so that isn't it.


malsup wrote:
 
 
 Any ideas why this would happen?
 
 This is why:
 
 http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F
 
 

-- 
View this message in context: 
http://www.nabble.com/jQuery-Form-Plugin---after-ajaxSubmit-call%2C-ajax-submitting-seems-to-be-disabled-tp21424793s27240p21425844.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: jQuery Form Plugin - after ajaxSubmit call, ajax submitting seems to be disabled

2009-01-12 Thread Mike Alsup

 My handler - as shown previously - rebinds events when the submit succeeds. I
 confirmed this, as stated in my message by adding an alert that is shown the
 next time I click the submit button, so that isn't it.

Sorry, I read your first message too quickly.  Is 'edit_card_jq' bound
as a submit handler?  If so, you should return false form that fn.  If
not, could you post a little more code or provide a link?

Mike


[jQuery] Re: jQuery Form Plugin - success callback function isn't called

2008-12-09 Thread [EMAIL PROTECTED]

Actually if you put a debugger;  statement there and debug with
firebug you will see that it actually gets called. But for some reason
the alert does not work. But other js code will work so you can show
your messages somewhere else on the page if you want or need to.

On 7 nov, 15:34, Mike Alsup [EMAIL PROTECTED] wrote:
  Theformsubmits as it should, using an AJAX call. When I add a
  beforeSubmitcallbackfunction to the options array, that gets called
  as well, as it should. Only the successcallback(the alert) isn't
  called and I don't know why.

 Maybe the call wasn't successful.  Can you post a link?


[jQuery] Re: jQuery Form Plugin - success callback function isn't called

2008-12-09 Thread [EMAIL PROTECTED]

I have the same problem here and the call sure is successful, because
the rest of the commands get executed.
The weird thing is that only the alert that does not get executed.
I have even inspected the response with firebug and repeated the tests
using selenium with and without the alert so I´m sure that the alert
does not work on these callbacks (including error and complete ones
either).

On 7 nov, 15:34, Mike Alsup [EMAIL PROTECTED] wrote:
  The form submits as it should, using an AJAX call. When I add a
  beforeSubmit callback function to the options array, that gets called
  as well, as it should. Only the success callback (the alert) isn't
  called and I don't know why.

 Maybe the call wasn't successful.  Can you post a link?


[jQuery] Re: jQuery Form Plugin - success callback function isn't called

2008-12-09 Thread Mike Alsup

 Actually if you put a debugger;  statement there and debug with
 firebug you will see that it actually gets called. But for some reason
 the alert does not work. But other js code will work so you can show
 your messages somewhere else on the page if you want or need to.

Post a link so we can see it in action.


[jQuery] Re: jquery form plugin: fieldValue vs. val

2008-11-29 Thread Mike Alsup

 Greetings!

 I've 
 seenhttp://docs.jquery.com/JQuery_1.2_Roadmap#Form.2FField_Serializationhttp://docs.jquery.com/Release:jQuery_1.2/Attributes.

 Is fieldValue() still better then standard val()?


The main difference is that fieldSerialize tests for successful
elements and val does not.

http://www.w3.org/TR/html4/interact/forms.html#successful-controls


[jQuery] Re: jQuery Form Plugin - success callback function isn't called

2008-11-07 Thread jscheel

Hrm, I'm having the same problem. Anybody have any ideas?

On Oct 23, 6:34 am, Sebastian [EMAIL PROTECTED] wrote:
 Hey guys,

 I'm working with the jQueryFormPlugin and I'm having some trouble
 with it.
 In my HTML I have a button, which, when clicked, inserts aformvia
 jQuery. To then register theform'ssubmitevent, I use the
 livequerypluginin my (document).ready function:

 (document).ready(function($) {
   var options = {
         target:         '#editable_content',   // target element(s) to
 be updated with server response
         success:       function(responseText, statusText)
 { alert(responseText); },  //post-submitcallback
     };
   $('.edit_contact').livequery('submit', function() {
         $(this).ajaxSubmit(options);
         return false;
       });

 });

 Theformsubmits as it should, using an AJAX call. When I add a
 beforeSubmit callback function to the options array, that gets called
 as well, as it should. Only the success callback (the alert) isn't
 called and I don't know why.

 Can anyone help???

 Regards,

 Sebastian


[jQuery] Re: jQuery Form Plugin - success callback function isn't called

2008-11-07 Thread Mike Alsup

 The form submits as it should, using an AJAX call. When I add a
 beforeSubmit callback function to the options array, that gets called
 as well, as it should. Only the success callback (the alert) isn't
 called and I don't know why.

Maybe the call wasn't successful.  Can you post a link?


[jQuery] Re: jQuery Form Plugin using keyUp() or change() instead of submit

2008-10-28 Thread Mike Alsup

You can bind those events and call ajaxSubmit when appropriate.
ajaxForm waits on the submit event.

Mike


On Oct 27, 6:24 pm, brian mahoney [EMAIL PROTECTED] wrote:
  Is there a way to get  the  jQuery Form Plugin to work with a  
  keyUp() or change() instead of having to use a submit button?


[jQuery] Re: jQuery Form Plugin - File Upload Issues

2008-10-12 Thread Mike Alsup

 I have a form that works perfectly until I try to upload a file,
 please check out:

 http://freshbump.scheetzdesigns.com/

 Click the big blue Add the Next Image button and play with the form.
 If you don't add a file to upload, it works. Once you add a file, it's
 a no-go.

 There is documentation on how to handle the uploads, but the page
 gives no samples of code to actually use. Am I missing something?

 http://www.malsup.com/jquery/form/#code-samples

 Any help would be HUGELY appreciated!


Can you provide a link that doesn't require registration?



[jQuery] Re: jQuery Form Plugin

2008-10-03 Thread Mike Alsup

 Don't you think we can have this feature built-in ?
 Something like $('form').ajaxForm('cancel')
 I don't know exactly where I can post this request

Hi Andre,

This is the right place to post your request.  I've added it to my
list of items to evaluate for future releases.

Cheers!

Mike



[jQuery] Re: jQuery Form Plugin

2008-10-02 Thread Mike Alsup

Hmm, haven't tried it but I suppose you could do this:

$('iframe[id^=jqFormIO']).attr('src','about:blank');

Mike


On Oct 2, 8:56 am, André Cassal [EMAIL PROTECTED] wrote:
 Hey Folks,

 Can I cancel a connection during an upload?

 I'm using this form pluginhttp://www.malsup.com/jquery/form/and a
 dialog showing the process, but the dialog needs to have a cancel
 button to trigger a client-side cancel.

 As this plugin uses an iframe to target a form, I need just change the
 iframe src to 'about:blank'. But it seems not to have an open way to
 control the iframe.

 any thoughts?


[jQuery] Re: jQuery Form Plugin

2008-10-02 Thread André Cassal

Hey Mike, thanks, it works.

Don't you think we can have this feature built-in ?
Something like $('form').ajaxForm('cancel')
I don't know exactly where I can post this request

Best,
André


On Oct 2, 10:20 am, Mike Alsup [EMAIL PROTECTED] wrote:
 Hmm, haven't tried it but I suppose you could do this:

 $('iframe[id^=jqFormIO']).attr('src','about:blank');

 Mike

 On Oct 2, 8:56 am, André Cassal [EMAIL PROTECTED] wrote:

  Hey Folks,

  Can I cancel a connection during an upload?

  I'm using this form pluginhttp://www.malsup.com/jquery/form/anda
  dialog showing the process, but the dialog needs to have a cancel
  button to trigger a client-side cancel.

  As this plugin uses an iframe to target a form, I need just change the
  iframe src to 'about:blank'. But it seems not to have an open way to
  control the iframe.

  any thoughts?


[jQuery] Re: jQuery Form Plugin - success callback problem with FF/Chrome

2008-09-30 Thread Clemens

Hi Prajwala,

thanks for your feedback!

displayData(); ist not the problem as far as I've figured out, since
it's not even executed. The problem is that displayData() is not
called, even though the Ajax Request was executed successfully. Thanks
to you debugger hint I was able to pinpoint the problem a bit
further:

The form, along with it's jQuery code ist not present within the page
as it loads. Rather the whole code (form  jQuery stuff) is loaded via
an Ajax request later on, as a single HTML part within the page is
exchanged with the form. After loading the form the success callback
won't be triggered, even though the jQuery.ready(); stuff is executed.
onBeforeSubmit() callbacks won't work either under this specific
circumstances.

When reloading the page, all the contents are already present at load
time, causing the whole thing to work without any problems. So the
problem is somehow related to using jQuery().ready() when loading html
fragments using Ajax after the whole page has finished loading.
Whew... any hints someone?

Thanks for your effort!
Greets,
Clemens


[jQuery] Re: jQuery Form Plugin - success callback problem with FF/Chrome

2008-09-29 Thread Prajwala Manchikatla
I think you might be having some problem with the displayData function.
firebug will help you in debugging the code. put debugger statement before
displayData function and run on firefox after installing firebug. submit the
form, after getting response from server, the debugger will stop at debugger
statement. from there you can go through each step.

cheers,
Prajwala

On Mon, Sep 29, 2008 at 7:33 PM, Clemens [EMAIL PROTECTED] wrote:


 Hi,

 I'm using the jQuery Form Plugin to submit my form (#load), which then
 loads data from the server. Heres the JS:

 jQuery().ready(function() {
 // ... some code
jQuery(#load).ajaxForm({
dataType: json,
success: function(data) {
displayData(data);
},
});
 // ... some other code
 });

 The corresponding html code is

 form id=load action=[whatever - generated by the server]
label for=contentidContent-ID:/label
input type=text name=contentid /
input type=submit value=Load /
 /form

 Now, after clicking Load, data identified by a corresponding content
 id should be loaded from the server. The Ajax Request executes
 correctly, and the server provides the data as requested. This works
 every single time I try in Internet Explorer 7, but not with FF3 or
 Chrome. After adding alert(hello); to the success callback function,
 just before calling displayData() FF3 and Chrome will work fine too,
 even if I remove the alert call afterwards. When I reload my page,
 having no alert() within the success callback, the whole thing starts
 again.

 Hints are much appreciated :)
 Thanks for your help!

 Best regards,
 Clemens



[jQuery] Re: jQuery Form Plugin

2008-09-14 Thread René

Thanks for the tip, that's actually what I ended up doing. It's not so
bad actually, since at least after the user credentials are checked
once, I can set a validate bit to equal true, and then have the form
submit normally.


On Sep 13, 4:05 pm, Mike Alsup [EMAIL PROTECTED] wrote:
  I'm trying to use the beforeSubmit callback of the jQuery form plugin
  to check some values with the server before submitting the entire
  form, which can include a large file upload (which would be annoying
  to upload, and then fail due to other submitted values being invalid--
  hence the pre-submit check).

     For reference:http://malsup.com/jquery/form/#code-samples

  The problem I'm having with running an Ajax request within
  beforeSubmit, for example, is that it returns immediately (normally a
  good thing). But beforeSubmit needs to wait for the value before
  knowing whether it can return true or false.

  Anyone run into this before? I guess, in a nutshell, what I'm trying
  to do is validate part of the form data by submitting it to a
  different URL, then, depending on the response, submitting (or not
  submitting) the entire form to the primary URL.

  ...Rene

 You can accomplish this by always returning false from beforeSubmit.
 Then when you get the response from your validate ajax call you can
 submit the form manually.  You may want to check out the validation
 plugin though, it lets you define validation rules up front and
 processes them for you.

 Mike


[jQuery] Re: jQuery Form Plugin

2008-09-13 Thread Mike Alsup

 I'm trying to use the beforeSubmit callback of the jQuery form plugin
 to check some values with the server before submitting the entire
 form, which can include a large file upload (which would be annoying
 to upload, and then fail due to other submitted values being invalid--
 hence the pre-submit check).

    For reference:http://malsup.com/jquery/form/#code-samples

 The problem I'm having with running an Ajax request within
 beforeSubmit, for example, is that it returns immediately (normally a
 good thing). But beforeSubmit needs to wait for the value before
 knowing whether it can return true or false.

 Anyone run into this before? I guess, in a nutshell, what I'm trying
 to do is validate part of the form data by submitting it to a
 different URL, then, depending on the response, submitting (or not
 submitting) the entire form to the primary URL.

 ...Rene


You can accomplish this by always returning false from beforeSubmit.
Then when you get the response from your validate ajax call you can
submit the form manually.  You may want to check out the validation
plugin though, it lets you define validation rules up front and
processes them for you.

Mike



[jQuery] Re: JQuery Form Plugin and json

2008-09-12 Thread Stefan Sturm

Hello


 beforeSubmit: function(arr) {
var json = // ... build json string
arr.length = 0; // throw away current array contents (if you want)
arr[0] = { name: 'someName', value: json };
 }


thats it :-) Thanks...

Greetings,
Stefan Sturm


[jQuery] Re: JQuery Form Plugin and json

2008-09-11 Thread Mike Alsup

 Does jQuery provides a way to convert to JSON string?

 Felix Halim

There are plugins that provide that functionality.  This is a great
option as well:

http://www.json.org/json2.js

Mike



[jQuery] Re: JQuery Form Plugin and json

2008-09-11 Thread Alex Weber

Stefan,

Any particular reason why you'd want to do this??

Usually its the opposite... posting form fields normally (usually
easier to interpret by the server-side script) and then returning a
JSON object to jQuery, in which case you can use $.getJSON()

Alex

On Aug 29, 3:19 am, Stefan Sturm [EMAIL PROTECTED]
wrote:
 Hello,

 I'm using the jQuery Form PlugIn(http://www.malsup.com/jquery/form/)
 to handle my Forms. I like it, but I have a question about an
 improvment:
 At this time all form fields are send using post, but it wold be nice,
 to send all form fields json encoded as one post parameter.

 Is there a way to do this?

 Thanks and greetings,
 Stefan Sturm


[jQuery] Re: JQuery Form Plugin and json

2008-09-11 Thread Stefan Sturm

Hello,

thanks for your answer.
I made it the way you say. I build my json string in the beforeSubmit
function. So, now I have a correct json string, but how can I replace
the post array?
Sorry, but I hang at this point.

Thanks agin for your Help,
Stefan Sturm

2008/9/9 Mike Alsup [EMAIL PROTECTED]:


 It's not supported by the plugin, but you can hook the beforeSubmit
 event and change what is posted to the server.  beforeSubmit is passed
 an array of objects with name and value properties.  You could iterate
 over these, build your json string, and then replace the array
 contents with a single object that has name and value properties,
 where the value prop is the json string.

 Mike






 Mike



[jQuery] Re: JQuery Form Plugin and json

2008-09-11 Thread Mike Alsup

 thanks for your answer.
 I made it the way you say. I build my json string in the beforeSubmit
 function. So, now I have a correct json string, but how can I replace
 the post array?
 Sorry, but I hang at this point.

beforeSubmit: function(arr) {
var json = // ... build json string
arr.length = 0; // throw away current array contents (if you want)
arr[0] = { name: 'someName', value: json };
}


[jQuery] Re: JQuery Form Plugin and json

2008-09-10 Thread Felix Halim

Does jQuery provides a way to convert to JSON string?

Felix Halim

On Tue, Sep 9, 2008 at 10:22 PM, Mike Alsup [EMAIL PROTECTED] wrote:

  I'm using the jQuery Form PlugIn(http://www.malsup.com/jquery/form/)
  to handle my Forms. I like it, but I have a question about an
  improvment:
  At this time all form fields are send using post, but it wold be nice,
  to send all form fields json encoded as one post parameter.

  Is there a way to do this?

 I still searching for a solution for this...

 Hope, the developer is reading here :-)

 Greetings,
 Stefan Sturm


 It's not supported by the plugin, but you can hook the beforeSubmit
 event and change what is posted to the server.  beforeSubmit is passed
 an array of objects with name and value properties.  You could iterate
 over these, build your json string, and then replace the array
 contents with a single object that has name and value properties,
 where the value prop is the json string.

 Mike






 Mike



[jQuery] Re: JQuery Form Plugin and json

2008-09-09 Thread Stefan Sturm

Hello,

 I'm using the jQuery Form PlugIn( http://www.malsup.com/jquery/form/ )
 to handle my Forms. I like it, but I have a question about an
 improvment:
 At this time all form fields are send using post, but it wold be nice,
 to send all form fields json encoded as one post parameter.

 Is there a way to do this?

I still searching for a solution for this...

Hope, the developer is reading here :-)

Greetings,
Stefan Sturm


[jQuery] Re: JQuery Form Plugin and json

2008-09-09 Thread Mike Alsup

  I'm using the jQuery Form PlugIn(http://www.malsup.com/jquery/form/)
  to handle my Forms. I like it, but I have a question about an
  improvment:
  At this time all form fields are send using post, but it wold be nice,
  to send all form fields json encoded as one post parameter.

  Is there a way to do this?

 I still searching for a solution for this...

 Hope, the developer is reading here :-)

 Greetings,
 Stefan Sturm


It's not supported by the plugin, but you can hook the beforeSubmit
event and change what is posted to the server.  beforeSubmit is passed
an array of objects with name and value properties.  You could iterate
over these, build your json string, and then replace the array
contents with a single object that has name and value properties,
where the value prop is the json string.

Mike






Mike


[jQuery] Re: jQuery Form plugin file upload question

2008-08-21 Thread Mike Alsup

 trying to get a file upload to work but for some reason my inputs
 won't post

 this is what I have

 [code]
 var options = {
         url:       'includes/images.php?a=add',
         type:      'post',
         dataType:  'json',
         success:   processJson};

 var container = $('div.errors');
 // validate the form when it is submitted
 var validator = $(#newimage).validate({
         errorContainer: container,
         errorLabelContainer: $(ol, container),
         wrapper: 'li',
         meta: validate,
         submitHandler: function(form) {
                 $(#add-form).fadeOut(slow,function() {
                         $(form).ajaxSubmit(options);
                         return false;
                 });
         }});

 [/code]

 I have a hidden field in my form called total and I echo it out inside
 of images.php but it's as if the values aren't getting posted because
 it always turns out to be NULL, any reason why it isn't working?


Have you tried it without the fadeOut bit?  Can you post a link to a
test page?



[jQuery] Re: JQuery form plugin not uploading files

2008-08-21 Thread Mike Alsup



On Aug 19, 12:26 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Hello, this may be a stupid question, but im trying to make an upload
 from a form with the form plugin (excelent btw), the form data is sent
 to a DB through a php script. Here is the form:

 form action=upload_contrib.php method=post enctype=multipart/
 form-data id=form_contribs
                 div style=height:60px/div
                 span class=txtNombre de la imagen:/spanbr /
                 input name=img_uploader type=text class=large
 id=img_uploader /
                 div id=separador10/div
                 span class=txtDescripcioacute;n:/spanbr /
                 textarea name=img_coment cols= rows=
 id=img_coment/textarea
                 div id=separador10/div
                 div
                   span class=txt style=float:left; width:100pxTu
 nick:/span
                   span class=txt style=float:left; width:100px;
 padding-left:5pxTu correo:/span
                     div style=clear:both/div
                     input name=img_nick type=text class=short
 id=img_nick /
                     input name=img_mail type=text class=short
 id=img_mail style=padding-left:5px /
                 /div
                 div id=separador10/div
                 span class=txtBuscar imagen:/span
                 input name=img_name type=file /
                 input name=img_ip type=hidden id=img_ip
 value=?php echo $ip; ? /
                         input name=img_host type=hidden id=img_host 
 value=?
 php echo $servidor; ? /
                 input name=img_gal type=hidden id=img_gal
 value=?php echo $contribs_tipo; ? /
                 input name=uploadResponseType type=hidden
 id=uploadResponseType value=html /
                 input type=hidden name=MAX_FILE_SIZE
 value=10 /
                 div id=separador30/div
                 input name=enviar type=submit class=button
 id=enviar_formcontribs value= /
             /form

 The php script that sends the data (upload_contrib.php):

 cargar_contrib($_POST[img_uploader],$_POST[img_nick],
 $_POST[img_coment],$_POST[img_mail],$_POST[img_gal],
 $_POST[img_ip],$_POST[img_host]);
 echo si;

 The jquery script to process the form:

 $('#form_contribs').ajaxForm({
         beforeSubmit: function(a,f,o) {
             o.dataType = $('#uploadResponseType')[0].value;
             $('#uploadOutput').html('Submitting...');
         },
         success: function(data) {
             var $out = $('#uploadOutput');
             $out.html('Form success handler received: strong' +
 typeof data + '/strong');
             if (typeof data == 'object'  data.nodeType)
                 data = elementToString(data.documentElement, true);
             else if (typeof data == 'object')
                 data = objToString(data);
             $out.append('divpre'+ data +'/pre/div');
                         alert(data);
         }
     });

 I'm sorrybut nothing happens, when I submit the form, the response
 div shows this:

 insert into x
 (img_name,img_uploader,img_nick,img_coment,img_mail,img_gal,img_date_up,img_time_up,img_ip,img_host)
 values ('','nombreq','nick','asdfa
 afafaf','correo','2',NOW(),NOW(),'','')

 but nothing from the file field, and of course, the data is writen to
 the DB, but no file uploaded.

 Please advise. Thanks.


What's in the $_FILES object?  Did you do a var_dump or echo on that?

?php
foreach($_FILES as $file) {
$n = $file['name'];
$s = $file['size'];
echo File: $n ($s bytes);
}
?


[jQuery] Re: jquery form plugin - post method do not work in firefox3

2008-06-20 Thread Malthe Borch
pratikspace wrote:
  examples work fine. i dont know if this is something to do with perl. 
i am
  using modperl just to print the post parameter. thats it. nothing 
hard. the sample code i have provided above works perfectly fine on 
older firefox
  but not on firefox3. i am very puzzled.

fwiw, i'm experiencing this issue as well (on Zope).

\malthe
---BeginMessage---
pratikspace wrote:
 examples work fine. i dont know if this is something to do with perl. i am
 using modperl just to print the post parameter. thats it. nothing hard. 
 the sample code i have provided above works perfectly fine on older firefox
 but not on firefox3. 
 i am very puzzled. 

fwiw, i'm experiencing this issue as well (on Zope).

\malthe

---End Message---


[jQuery] Re: jquery form plugin - post method do not work in firefox3

2008-06-18 Thread Mike Alsup

 So if i do this on FireFox version lesser than 3 , it works nicely. data is
 submitted, i get proper alerts. BUT when i do this in FireFox3, i get the
 error msg, because data is empty after doing post.

I've not seen any problems with FF3.  Can you use the examples
successfully?

http://www.malsup.com/jquery/form/#code-samples

Mike


[jQuery] Re: jquery form plugin - post method do not work in firefox3

2008-06-18 Thread pratikspace


examples work fine. i dont know if this is something to do with perl. i am
using modperl just to print the post parameter. thats it. nothing hard. 
the sample code i have provided above works perfectly fine on older firefox
but not on firefox3. 
i am very puzzled. 

just to add some more info. 
if i check firebug on older firefox, i get post parameters in this format :

comment text
nameabc

and if i use firefox 3, i get following in firebug:
name=abccomment=text

I dont know if this is the possible problem. 

any more thoughts guys ?

thanks, 
P


malsup wrote:
 
 
 So if i do this on FireFox version lesser than 3 , it works nicely. data
 is
 submitted, i get proper alerts. BUT when i do this in FireFox3, i get the
 error msg, because data is empty after doing post.
 
 I've not seen any problems with FF3.  Can you use the examples
 successfully?
 
 http://www.malsup.com/jquery/form/#code-samples
 
 Mike
 
 

-- 
View this message in context: 
http://www.nabble.com/jquery-form-plugin---post-method-do-not-work-in-firefox3-tp17991742s27240p17993913.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: jquery form plugin - post method do not work in firefox3

2008-06-18 Thread mmw

I didn't dig in your code but it's working for me
I tested my apps that do exactly the same thing a json-rpc
communication

client - send
string:hello world!
server - receive - answer
string:ok gotcha

then I guess, it's a pratikspace's bug :)


On Jun 18, 3:31 pm, Mike Alsup [EMAIL PROTECTED] wrote:
  So if i do this on FireFox version lesser than 3 , it works nicely. data is
  submitted, i get proper alerts. BUT when i do this in FireFox3, i get the
  error msg, because data is empty after doing post.

 I've not seen any problems with FF3.  Can you use the examples
 successfully?

 http://www.malsup.com/jquery/form/#code-samples

 Mike


[jQuery] Re: jQuery Form Plugin target confusion

2008-05-29 Thread Aree

Hey Lasthaai,

I suffered the same issue and realised what was going on. Given that $
(this) is bound back to this function in which it currently resides,
affectively causes an infinite loop. Here is a way around this issue,
while still using the jquery forum plugin:

$(function() {
for (var i = $('.form').length - 1; i = 0; i--){
$('.form:eq('+i+')').ajaxForm({
target: '.form:eq('+i+')  .recommend'
beforeSubmit: function(data, set, options) {
alert( $(set).attr( 'action' ) );
}
});
};
});

Hope this works for you :)

Aree

On Apr 9, 3:36 am, Iasthaai [EMAIL PROTECTED] wrote:
 I'm using the jQuery form plugin and specifying my target as so:

 $(function() {
 var _options = {
 target: $( this ),
 beforeSubmit: function(data, set, options) {
   alert( $(set).attr( 'action' ) );
 }
 }
 $( '.form' ).ajaxForm( _options );

 });

 I've also tried using just the 'this' keyword. Anyway, when I use this
 it freezes the browser... My goal is to make the response target
 wrapper the same form that I'm submitting (basically a refresh of the
 newly updated form). I can't just leave the form as is due to some
 extra bits of JS that aren't form elements that will be reset when the
 response is loaded.

 Am I specifying my target incorrectly for what I want to achieve?

 PS: I've changed my target to the specificy form using an id and also
 I set the target to $( '.form' ) which posts the response in ALL of my
 forms, so I know that it is working, just not with the 'this' keyword
 for some reason.


[jQuery] Re: JQuery Form Plugin returns nothing in Opera

2008-05-08 Thread Mike Alsup

 I've got a form that uploads a file. It's an AJAX form, initialized by the
 following code:

 $(document).ready(
 function()
 {
  $('#filer').ajaxForm(
  {
  target: '#vars',
  beforeSubmit: function(formData, jqForm, options) { alert('sending'); },
  success: function(responseText, statusText) { alert(responseText); }
  });
 });

  an the form is:

 form id='filer' name='filer' action='catcher.php' method='post'
 enctype='multipart/form-data'
  input type='file' name='upload'br
  input type='submit' value='Load'
 /form
 div id='vars'/div

  The problem: responseText is empty in Opera after submit. It is filled by
 the correct response of catcher.php in IE, FF and Safari. The contents of
 catcher.php means nothing - I tested it with only an 'ok' in that file -
 Opera shows noting, the other browsers show 'ok'.

  I am using the lates stable versions of all browsers and latest jquery.js +
 jquery.form.js.

 What could that be?

Thanks for reporting this.  It seems to be a regression (or at least a
timing change) in the Opera 9.2.x line.  If I use Opera v9.1
everything works fine, but the 9.2+ fails.  Can you try this version
of the form plugin to see if it works for you?

http://malsup.com/jquery/form/jquery.form.2.09.js

Mike


[jQuery] Re: jQuery Form Plugin file upload problem

2008-05-05 Thread dtc

Hi Mike,

Thank you for your prompt response!  Unfortunately, I'm still in a
development stage and won't be able to provide you a link to a
publicly accessible page.

However if I may, I'd like to provide some code snippets and hopefully
it might help.  First off, the code for the form is derived from a
JSP, with the form tag as follows:

form id=dialog_form action=refer.do method=POST
enctype=multipart/form-data

The form has a number of hidden fields as well as text fields, and
finally the file input field:

input type=file name=dialogDatafile size=40

And a regular form submit button.

The Javascript code initializes the form to ajaxForm once the DOM is
loaded:

function initReferDialog() {
$('#dialog_form').ajaxForm({
beforeSubmit: validateReferDialog,
success: referDialogSuccess
});
}

My validateReferDialog method is as follows:

function validateReferDialog(formData, jqForm, options) {
if (($('#dialogName').val() ==  || $('#dialogEmpName').val() ==
 || $('#dialogEmpEmail').val() == )) {
$('#dialogMessage').empty().append(span class='red-
bold'Please fill in all required fields (*)/spanbr/br/);
return false;
}
return true;
}

I believe I've utilized your APIs correctly.  The one thing I've
noticed, is that when I don't include a file to be uploaded, the
request does get sent to my servlet, however the enctype is
application x-www-form-urlencoded.  I believe in this case it gets
sent via the XMLHttpRequest object.  It's only if I include the file
that it doesn't even reach my servlet.  To test this, I simply have a
print statement as the first line of my servlet.  This statement
should always print out if the servlet is executed.

Is there anything special I have to do with the iframe?  Or is it
possible that since I'm utilizing the form within a SimpleModal dialog
box, that it's causing the issue?

Again Mike, thank you for helping me out with this.  I'm really very
new to jQuery, but I find the library the best I've ever used, and the
fact that there is a thriving community out there willing to
contribute with people such as yourself, makes it all the more better
to use.

-Dave


On May 4, 8:30 pm, Mike Alsup [EMAIL PROTECTED] wrote:
   I'm attempting to use the jQuery Form Plugin on a page that has
   multiple forms.  The particular form I am using to allow the uploading
   of files is the third form on the page.  I'm also using that form
   within a modal dialog box, using the SimpleModal jQuery plugin.  I
   have a Java Servlet handling the form submission.

   I am having a problem when I try to upload a file.  It looks like the
   request never gets to my servlet.  When I fill out the other fields of
   the form out, leaving the upload blank, it's working fine.  However,
   once I attempt to include a file to upload, the servlet never gets
   invoked.

   I understand that the XMLHttpRequest cannot send files over, but that
   the Forms Plugin utilizes an iFrame to do so.  However, it's not
   working in my case.  I've read a blog in which the person is able to
   address this, found here:  
  http://www.ender.com/2008/04/jquery-the-jquery-form-plugin.html.
   I tried his suggestions of including a hidden field in my form, but
   it's still not reaching my servlet.

   Could the problem actually be the fact that I have more than one form
   on the page?  Any help would be greatly appreciated.  Thanks.

 The Form Plugin fully supports multiple forms on a page so that
 shouldn't be causing your problem.  Can you post a link to your page?


[jQuery] Re: jQuery Form Plugin file upload problem

2008-05-05 Thread dtc

Hi Mike,

To hopefully add some more insight into this, I took the form out of
the SimpleModal jQuery plugin and placed it into its own JSP page, and
when I tried to submit the Form, the browser is reporting an error in
line 334 of the jquery.form.js file, stating that:

form.submit is not a function

This happens in both Firefox 2.0 and IE6.

Regards,
Dave

On May 4, 8:30 pm, Mike Alsup [EMAIL PROTECTED] wrote:
   I'm attempting to use the jQuery Form Plugin on a page that has
   multiple forms.  The particular form I am using to allow the uploading
   of files is the third form on the page.  I'm also using that form
   within a modal dialog box, using the SimpleModal jQuery plugin.  I
   have a Java Servlet handling the form submission.

   I am having a problem when I try to upload a file.  It looks like the
   request never gets to my servlet.  When I fill out the other fields of
   the form out, leaving the upload blank, it's working fine.  However,
   once I attempt to include a file to upload, the servlet never gets
   invoked.

   I understand that the XMLHttpRequest cannot send files over, but that
   the Forms Plugin utilizes an iFrame to do so.  However, it's not
   working in my case.  I've read a blog in which the person is able to
   address this, found here:  
  http://www.ender.com/2008/04/jquery-the-jquery-form-plugin.html.
   I tried his suggestions of including a hidden field in my form, but
   it's still not reaching my servlet.

   Could the problem actually be the fact that I have more than one form
   on the page?  Any help would be greatly appreciated.  Thanks.

 The Form Plugin fully supports multiple forms on a page so that
 shouldn't be causing your problem.  Can you post a link to your page?


[jQuery] Re: jQuery Form Plugin file upload problem

2008-05-05 Thread Mike Alsup

  form.submit is not a function

  This happens in both Firefox 2.0 and IE6.


That error is usually the result of having a form element with an id
or name of 'submit'.  That is not a valid name for a form element (at
least not when using JavaScript).

Dave, have you tried removing the plugin from the equation to see if
submitting the form via the browser gets the data to your servlet?
When uploading a file that essentially what is happening.  The form
plugin simply submits the form using form.submit() and redirects the
response to an iframe.

Mike


[jQuery] Re: jQuery Form Plugin file upload problem

2008-05-05 Thread dtc

Mike,

That was it!  Indeed there was a form element with the name submit
and like you said, was causing that error.  Renaming it allowed the
plugin to do its job.

Thank you again!

Best,
Dave

On May 5, 7:03 am, Mike Alsup [EMAIL PROTECTED] wrote:
   form.submit is not a function

   This happens in both Firefox 2.0 and IE6.

 That error is usually the result of having a form element with an id
 or name of 'submit'.  That is not a valid name for a form element (at
 least not when using JavaScript).

 Dave, have you tried removing the plugin from the equation to see if
 submitting the form via the browser gets the data to your servlet?
 When uploading a file that essentially what is happening.  The form
 plugin simply submits the form using form.submit() and redirects the
 response to an iframe.

 Mike


[jQuery] Re: jQuery Form Plugin file upload problem

2008-05-04 Thread Mike Alsup

  I'm attempting to use the jQuery Form Plugin on a page that has
  multiple forms.  The particular form I am using to allow the uploading
  of files is the third form on the page.  I'm also using that form
  within a modal dialog box, using the SimpleModal jQuery plugin.  I
  have a Java Servlet handling the form submission.

  I am having a problem when I try to upload a file.  It looks like the
  request never gets to my servlet.  When I fill out the other fields of
  the form out, leaving the upload blank, it's working fine.  However,
  once I attempt to include a file to upload, the servlet never gets
  invoked.

  I understand that the XMLHttpRequest cannot send files over, but that
  the Forms Plugin utilizes an iFrame to do so.  However, it's not
  working in my case.  I've read a blog in which the person is able to
  address this, found here:  
 http://www.ender.com/2008/04/jquery-the-jquery-form-plugin.html.
  I tried his suggestions of including a hidden field in my form, but
  it's still not reaching my servlet.

  Could the problem actually be the fact that I have more than one form
  on the page?  Any help would be greatly appreciated.  Thanks.

The Form Plugin fully supports multiple forms on a page so that
shouldn't be causing your problem.  Can you post a link to your page?


  1   2   >