AyeCode / invoicing

GetPaid (Formerly the Invoicing plugin) is a lightweight Payments and Invoicing system for WordPress. It can be used to sell anything online via payment forms or buy now buttons that can be added to any landing page. It can also be used by freelancers to manage their Invoices or by 3rd party Themes and Plugins as their payment system. GeoDirectory currently uses GetPaid as its payment system
https://wpgetpaid.com/
Other
39 stars 22 forks source link

Form field IDs changing after every refresh make it impossible to write a JS script #610

Closed pol76 closed 3 years ago

pol76 commented 3 years ago

We need fixed ids in form fields.

I'm trying to write a javascript snippet to interact with the form data and I can't because after every refresh the field IDs are changed making the script useless.

For example, here the IDs of the Start and End date fields change after every page refresh. https://greenlagoonsurfing.com/book-surf-lessons/

It would be great if we had an option to add the field label as the field ID.

Thanks,

picocodes commented 3 years ago

is it possible to use css classes instead of ids in your JS? If we used fixed ids then users will not be able to add the same form twice on a single page.

picocodes commented 3 years ago

In your case, you can select the number of people field using the name attribute as that never changes.

jQuery('input[name="kkcpjtmsg"' );

Though I've also made some changes to convert the label into a class name to make such selections easier.