in reply to Perl Mason2 jquery get the value of a checkbox
It is important to understand that Perl works on the server side, and JavaScript works in the user’s browser. That these two might be on the same computer, does not matter.
JavaScript can only mangle the HTML, the DOM of the web page — its changes are local to the browser, and by default, there’s nothing more to it.
The server (a web server with a Perl application interpreting the requests in this case) only knows about HTTP requests being made to it. The only time the Perl script runs, is when there’s an HTTP request being made by the user.
This brings us to, thus: On the client side, you use JavaScript to prepare values in form fields, use either JavaScript or the user clicking on the submit button to submit the form — the browser makes an HTTP request to the server with the appropriate form data added, and then the Perl script can deal with any kind of form fields (variables) it received.
Long story short: to get the JS variable cb to be in the Perl variable $cb you need to submit its value as the value of a form item (named anything, really), and then put the value of said form field into the Perl variable.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Mason2 jquery get the value of a checkbox
by Anonymous Monk on May 30, 2012 at 23:00 UTC | |
by Ralesk (Pilgrim) on May 30, 2012 at 23:15 UTC |