I can't add space

Hi pullo i tried it and it works,i disabled the JS,…but i have still problem you are using $(“input:submit”) but my code here is i am getting the id of my submit,that’s why i could not process the php script if the JS is disabled…do you have some idea ?or i need to recode and use this $(“input:submit”) ?

Thank you in advance.

Hi jemz,

Sorry, that was left in the code from a previous experiment where I had two submit buttons.
You could just as easily write $("#myForm").on("submit", function(){ ... }) or something like that.

If you can post a code sample, I’m sure we’ll be able to get it working with AJAX and without.

Hi pullo, Can i ask about this part

var newValue = el.val().replace(/\s+/g, ‘’);

Thank you in advance :slight_smile:

That just strips all of the white space out of the string, so that the program can figure out where to reinsert the spaces.
If you didn’t have that it would start inserting double spaces and so on and things would get messy.

Basically it transforms this “123 456 789” into this “123456789”

Thank you pullo :slight_smile: