I am writing a simple dice roller and I would like to pass three form fields to a Perl script, crunch them, and return the result to the same page. I have everything working except the same page requirement.
Is this possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Make an AJAX call (in JS) to your Perl program.
Have your Perl program return the results nicely (eg JSON).
Make your AJAX handler make changes to the page based on the JSON data returned.
If you drop the “same page” requirement, then the previous answers will work (note that those answers are NOT the “same page”, they just look like the same page). This is most likely the easiest way to accomplish your goal, but to use it you must drop the “same page” requirement.