I've got a credit card form and on submission it requires that the expiry date is submitted from a single string as mmyy. Instead, the form is mm and yy in separate submission boxes.
I figured it would be possible to take the two value's and combine them by sitcking them into a hidden field.
I found a script online and due to my very limited knowledge of javascript I wouldn't actually know what to do with this and it looks looks somewhat incomplete:
Then call the function with onchange on your lastname field <input ID="LastName" value="" onChange="populate()"
I'm completely full of cold at the moment so my brains not firing on all thrusters.
Would this require any library like jquery to work?
If there's a way to do this without javascript that would be even better. Thing is as the forms being submitted via a thirdparty api I don't have the luxury of combining them via PHP at form submission.
I do not use the AdGuard extension. I have uninstalled both the uBlock and Stylus extensions, as well as the Tampermonkey extension, since I began using AdGuard for Windows 7 months ago.
It does not use any extension APIs, it modifies traffic system wide using a local proxy. AdGuard performs all the functions of uBlock, as well as additional features such as HTTPS filtering, cosmetic (user scripts and user styles), as well as DNS. It works with any browser and application. I don't understand why you consider the desktop program to be useless...
Should Google be forced to stop promoting Chrome over other browsers?
Google pushes Chrome to anyone visiting its website using browsers other than Chrome.
Question
Axel
I've got a credit card form and on submission it requires that the expiry date is submitted from a single string as mmyy. Instead, the form is mm and yy in separate submission boxes.
I figured it would be possible to take the two value's and combine them by sitcking them into a hidden field.
I found a script online and due to my very limited knowledge of javascript I wouldn't actually know what to do with this and it looks looks somewhat incomplete:
I'm completely full of cold at the moment so my brains not firing on all thrusters.
Would this require any library like jquery to work?
If there's a way to do this without javascript that would be even better. Thing is as the forms being submitted via a thirdparty api I don't have the luxury of combining them via PHP at form submission.
Appreciate any help.
Many thanks.
Alex
Link to comment
https://www.neowin.net/forum/topic/1133384-javascript-combine-2-form-fields-into-one/Share on other sites
8 answers to this question
Recommended Posts