good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^4: obtaining yyyy-mm-dd via a calendar objectby Asim (Hermit) |
on Jul 31, 2006 at 14:45 UTC ( [id://564755]=note: print w/replies, xml ) | Need Help?? |
I'd rather be able to keep the javascript separate if there is a way to do so... You can always generate it as a separate file, and link it into your HTML. Also, Perl has a number of Templating modules, such as HTML::Template and Template Toolkit, which are designed to cleanly pull the HTML (and, by extension, Javascript embedded in HTML and/or "pure" Javascript files) formatting out of your Perl code. *EDIT because I forgot to put this back in* To reference the answer from the Javascript in the HTML you're creating, you'll need, ironically, to set the Value of the textfield to equal the value of the Javascript -- although there are other ways, this might be the cleanest. You would do something like document.getElementById("response1”).value = "text_of_answer" to set it, and you can put it where you need to within the Javascript itself. Having said that...if you're unfamiliar with Javascript, you're likely best to do some research and testing with static files containing HTML and Javascript, and then come back to implementing CGI. Even if your values are from CGI forms, you can just use a test variable and roll with it. You're trying to cover a LOT of newtech in one go, and I think, from reading your past writeups, this might be causing you frustration. Take one chuck of tech (HTML, Javascript, Perl, etc.) at a time, play with them, and you should find great success! *Another minute, another EDIT...* Try the new Mozilla Javascript site -- it's basically the replacement for the site in the CGI docs you found was dead. Goes off to check into making a small patch to the CGI.pm docs... ----Asim, known to some as Woodrow.
In Section
Seekers of Perl Wisdom
|
|