hi
this is something new I learned this week, and I hope someone can shed some light about it. i'm wondering why my ajax post receives disabled value? traditionally it shouldn't, right?
here's my code snippet
this is the page which sends the data
and here's the function saveAll()Code:<form name='submitMyForm' method='POST'> <input type=text name='cicak' value='blablabla' disabled='true'> <input type=button value='Submit All' onClick='saveAll(submitMyForm);'></form>
and here's the saveExpenses.phpCode:function saveAll(getForm){ xmlHttp = GetXMLHttpObject() if (xmlHttp==null){ alert ("Browser doesn't support HTTP request") return } var url = "saveExpenses.php"; var params = createQuery(getForm); xmlHttp.onreadystatechange=stateChanged xmlHttp.open("POST",url,true) xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", params.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.send(params); }
it displays the value in 'cicak', which is 'blablabla', although the field 'cicak' is disabled. how do I make it work just like normal submit form, which doesn't send/receive disabled input.Code:$cicak = $_POST['cicak']; echo "cicak: ".$cicak;
any help is greatly appreciated. thank you very much


Reply With Quote
Bookmarks