Click to See Complete Forum and Search --> : Getting A Javascript Variable Back To Perl


artcabot
09-24-2003, 05:49 PM
I'm working on a form processing Perl script written by someone else. One section has a series of radio buttons that I need to get a value out of. The other developer is validating the form using Javascript and, at one point, already has a routine that determines that one of the buttons is checked (formName.item[i].checked = true). I'd like to grab the value at that point (formName.item[i].value) and send it out to the Perl script in which the Javascript routine is embedded.

If my Perl variable is, say, $MyVariable, how do I pass the Javascript information (formName.item[i].value) back to $MyVariable.

Thanks for the help; I know this is pretty basic, but I don't do much work in these two languages.

artcabot
09-25-2003, 04:25 PM
The JavaScript forum let me know that I couldn't do what I wanted because of the different environments that the code was running in.

However, I was able to put the information in a form field from JS. The syntax for that field on the form is:
<input name=prem_name value="$premium_name" size=20>

and it shows up, but when the form is submitted, the variable $premium_name is empty. Is there a problem because I entered the value programatically? I didn't think that was a problem, but something sure is wrong.

Any help from you experienced Perl programmers will be greatly appreciated!

artcabot
09-25-2003, 08:15 PM
I think I answered my own question in the process of posting. I'd missed the target of ACTION in the POST of the form.