In order to submit the disabled elements in JS I found this method of using a hidden element. However, due to lack of knowledge of web languages I am unable to make it work and therefore I would like to know the code for following:
- Defining a hidden element(variable) in HTML.
- Updating the element in JS.
- Using the element(variable) in CGI.
What have you tried for yourself so far?
What you are asking is kind of broad and, well, pretty basic stuff. Anyway, something like this should do it:
Define the hidden element:
Update the element using JavaScript:
Use the element in your server-side code depends heavily on your choice of platform. I’ll leave that one up to you, but you should know that sending the element to the server using a POST or GET request should make it accessible to whatever language it is you are using.
IE, using JavaScript to send the data to the server and PHP to read it out:
JavaScript:
PHP: