Modify value of hidden field on the fly
-
I created a hidden field named “Referring Site” and I need to update the value based upon what was stored in a cookie via JavaScript when the user first arrived to my site. Want to have this info included in email.
I tried to modify it after the page has loaded using the getElementsByName(“Referring-Site”).value method, but it isn’t working and “name=” is also deprecated in HTML5. Any chance of a future update that will assign an “id=” to all form fields, and if so, wouldn’t I then be able to use getElementById(“<id>”).value to perform the update?
Also, any idea why this isn’t updating the hidden field value on the page? I’m pretty familiar with performing these types of on-page updates and haven’t run into this.
I also tried using the si_contact_email_fields_posted filter hook to modify the $email_fields via PHP, but this also is not working (probably my logic – PHP (server) and JavaScript (Client) can’t share the variables without some AJAX or Get/Post.)
Any assistance would be greatly appreciated. Thank you for a great plugin!
- The topic ‘Modify value of hidden field on the fly’ is closed to new replies.