EasyUI Forum
May 08, 2024, 01:30:24 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: FORM Post result error if submit with Internet Explorer IE and Remote Server  (Read 23439 times)
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« on: July 11, 2014, 05:15:54 AM »

We use an EasyUi form and submit the form data with ajax call to the remote server. The server result is an JSON object.

With Firefox Browser all works fine. The request is send to server and the Result is OK.

With IE 10 the form event 'success' is not triggert, but the IE will save the remote server result as an xxx.json file!

Is this an bug with forms or an jQuery Problem or must we set some special attributes to the form element?

Code:
$('#form1').form({
  url:'addData.do',
 
  //events of submit form data!
    onSubmit: function(param){ //Fires before submit, return false to prevent submit action.
    return true;
    },
    success: function(data) { //Fires when the form is submitted successfuly.
//this is not called on IE
     var parsedData= jQuery.parseJSON(data);    
    }
});

//Bind click handler to action button
 $('#btnWaveFormSubmit').bind('click', function(){
$('#form1').form('submit');
 });

« Last Edit: August 10, 2014, 11:36:49 PM by Stefan B. » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: July 11, 2014, 05:59:35 AM »

Please visit this tutorial http://www.jeasyui.com/tutorial/form/form1.php
This example works fine.
http://www.jeasyui.com/tutorial/form/form1_demo.html
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #2 on: July 11, 2014, 06:08:23 AM »

Yes this Demo works. But what is the result format of the action "form1_proc.php"?
It looks like "text/html" and not formated at application/json

Please try a test with an json object response.

We use an tomcat server and use Sping Framework with an java controller where we send results as JSON Objects.

Every time it works when we use jquery $(post) with the same action url.
But know we tests to use direct the easyui form object and then it not working  Huh
« Last Edit: July 11, 2014, 06:12:48 AM by Stefan B. » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: July 11, 2014, 06:19:12 AM »

The data returned from form1_proc.php is a simple string. In your example, you must convert your json string to JavaScript object. Please confirm if your returned data is correct. Try using firebug to console it out.
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #4 on: July 11, 2014, 06:32:36 AM »

Sorry, but the data are correct.
In firefox is working! Not in IE  Huh
Logged
BegeMode
Newbie
*
Posts: 6


View Profile
« Reply #5 on: July 14, 2014, 05:33:12 AM »

I have a similar problem in IE11:
after form.submit() immediately called form.success with empty data and then the controller action

in FF it works.

I changed the line 7524 in jquery.easyui-1.3.6.js ("onload" instead "load"):
 _44e.bind("onload", cb);

....and the form.success is not called in IE11
Logged
BegeMode
Newbie
*
Posts: 6


View Profile
« Reply #6 on: July 14, 2014, 07:14:58 AM »

I found the error - if the form has an input field type="password", then the method form.success is called immediately
in IE11
Logged
BegeMode
Newbie
*
Posts: 6


View Profile
« Reply #7 on: July 14, 2014, 07:26:26 AM »

i found solution: http://social.msdn.microsoft.com/Forums/ie/en-US/7d02173f-8f45-4a74-90bf-5dfbd8f9c1de/ie-11-issue-with-two-password-input-fields
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #8 on: August 04, 2014, 12:10:44 AM »

Hi BegeMode, we don't have any password fields. And the problem is not fixed.
So what should we do? I have not found any  solution for this problem!
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #9 on: August 06, 2014, 01:53:46 AM »

Is there anyone how can help me with this problem. It is not fixed!

I have found some information on web but i don't know how to fix it?

http://crazytechthoughts.blogspot.de/2011/01/get-json-data-response-with-jquery-form.html
http://stackoverflow.com/questions/8892819/ie8-treats-json-response-as-file-and-tries-to-download-it

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!