Topic: empty input fields in IE8 send as "null"

hi.

i have problem in IE8.(maybe other vesion).
if i submit form with empty input fields,
on server site i get json with value "null" (must be "")

i think problem is in usage function

oVal = JSON.stringify(oVal);

xajax_core.js line 3266

Re: empty input fields in IE8 send as "null"

Hello,

please copy out the Firebug Console tab "Post"
so we can have a look into real send json parameters.

Re: empty input fields in IE8 send as "null"

for Firefox it works correct. only for IE problem
i eneble debug

ORG_NAME is inlut field with empty value

for Firefox it will be

&xjxargs[]={"ORG_NAME":"",......

but for IE sad

Wed Aug 1 15:14:15 UTC+0300 2012
POST: xjxfun=saveOrganization&xjxr=1343823255281&xjxargs[]={"ORG_NAME":"null","ORG_URL_PREFIX":"wwwwadsf","ORG_MAIL":"akonjakow@yukon.cv.ua","ORG_WEBSITE":"artur.fff.ua","ORG_COUNTRY":"NL","ORG_ADDRESS":"aa","ORG_ADDRESS_NUMBER":"a","ORG_ADDRESS2":"gggggggggggggggg","ORG_CITY":"aaa","ORG_COUNTY":"null","ORG_ZIPCODE":"aa","ORG_SHOW_ADDRESS":"1","ORG_PHONE":"aaa","SEGMENT_ID":"5","ORG_CHARACTERISTICS":"null","ORG_DESCK":"null","logo_upload":"null","file":"null","file_name_inp":"newfile","LOGO":"logo.gif","logo_default":"null","TEXT_LOGO":"new slogan f'r 'wl","ORG_CODE":"83404d2b49cb9b71b"}

i checked js

oVal = JSON.stringify(oVal);
alert(oVal );
xajax_core.js line 3266

before JSON.stringify parameter is empty but in json transformed in to "null"

Re: empty input fields in IE8 send as "null"

Hello akonjakow,

i will try to simulate you behavior next 2 days.

Re: empty input fields in IE8 send as "null"

hi.
i spent more time for this problem. i think problem in <!DOCTYPE html>
without doctype IE8 works nice. if i add doctype on server i will receive 'null' in test field if live it empty

example. just submit empty form

<?php
include './xajax_core/xajax.inc.php';

$xajax = new xajax();

$xajax->register(XAJAX_FUNCTION, 'action');

$xajax->processRequest();

function action($form)
{
    $response = new xajaxResponse();

    $log=fopen('1.txt','a');
    fwrite($log,print_r($form,1));
    fclose($log);exit;
    return $response;
}
?>
<!DOCTYPE html>
<html>
<head>
<?=$xajax->getJavascript(_XAJAX_JS_DIR,NULL)?>
<head>
<body>
<form id='formID' onsubmit='return false;'>
<input type='text' name='test'>
<button type='submit' onclick='xajax_action(xajax.getFormValues("formID"));' >Send</button>
</form>
</body>
</html>

Re: empty input fields in IE8 send as "null"

hi.
problem is solved:)

it was bug of IE8 without last updates sad
after updating windows with IE lib works nice.

sorry about many posts