artcabot
09-25-2003, 08:16 AM
How do I set the value of a Perl variable ($variable) from a JS routine inside a Perl script?
|
Click to See Complete Forum and Search --> : Accessing Perl Variable From Javascript artcabot 09-25-2003, 08:16 AM How do I set the value of a Perl variable ($variable) from a JS routine inside a Perl script? Khalid Ali 09-25-2003, 08:30 AM Can't do that.from client to server you can only go through by using a HTTP get or post request. artcabot 09-25-2003, 04:20 PM Thanks, Khalid. Maybe you can give me another clue... I was able to put it in a form field from JS (field syntax:<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. Khalid Ali 09-25-2003, 04:25 PM wha tyou will need to do is whatever values you have in form fields,submit the form to your server side handler(perl in this case) and in their you will need to parse the HTTP Request object to retrieve values from form controls. artcabot 09-25-2003, 04:37 PM What you say makes perfect sense, but what why do all the other fields entered on the form get assigned to the Perl variable in the <input name...> line (where I have $premium_name in the example I sent before) without anything else being done? I'm trying to use what the developer before me wrote and all the other form fields are just there . Your help is appreciated more than I can say. Do you have any idea why this field doesn't get assigned to it's variable? Is it because the value wasn't typed in but entered via code? artcabot 09-25-2003, 08:28 PM I feel really dumb, I missed something as plain as the nose on my face! I totally ignored the target of the form's ACTION POST. The variable I wanted to use is one that I added! That's why it's not being handled in the Perl script I missed. Thanks for your patience. Khalid Ali 09-25-2003, 11:12 PM No problem :D webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |