开发者

Selecting specific elements of form to send to $_POST

开发者 https://www.devze.com 2023-03-10 00:44 出处:网络
I\'ve got a populated table which admins can edit and a submit button to apply all the changes made but I was wondering if I could narrow it down to on开发者_如何学Goly the ones they changed? I don\'t

I've got a populated table which admins can edit and a submit button to apply all the changes made but I was wondering if I could narrow it down to on开发者_如何学Goly the ones they changed? I don't mind having an extra checkbox to specify whether it requires updating or not which the user can check but I don't know how to send ONLY those parts of the form to $_POST.

Thanks in advance.


The entire form will be posted by default.

To do what you want to do you can of course go the Javascript way.

Making users click on e.g. a checkbox for the records they have changed wouldn't be the preferred way IMO.


You could use JavaScript to note the changes, update a hidden field and post these instead.

You could also add the current values to the session and then check on submission which ones have changed by comparing the session values to the post values.

0

精彩评论

暂无评论...
验证码 换一张
取 消