Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
Tuesday, May 26, 2015
Difference between set empty and set null in jquery input value
I posted form data in Modal form using $('form#populate').serializeArray().
I manually set an input text box empty
$("input[name='StudentID']").val(' ');
But when I use PHP empty function, the post data from StudentID is not empty. I used Network in web developer tools in Firefox and see the post data is "+". (Although finally it will transfer to empty string)
Finally I set it as null
$("input[name='StudentID']").val(null);
The post.data is " " in web tools and make empty function judges correctly.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment