![]() |
|
![]() | ||
|
Subject:
Perl HTML:Form ? How do I call the click method and avoid javascript alerts?
Category: Computers > Programming Asked by: guysmiley-ga List Price: $10.00 |
Posted:
02 May 2002 13:59 PDT
Expires: 02 May 2002 19:11 PDT Question ID: 11162 |
Using Perl's HTML::Form module, I am trying to change a hidden value in a form before the form is posted. Here's a slice of code that I'm using. my $apclick = $form->find_input('click'); my $apsearch = $form->find_input($search); my $aptitle = $form->find_input($title); my $apdesc = $form->find_input($desc); my $apurl = $form->find_input($url); $form->value( $apclick, 'true'); # this line returns error $form->value( $apsearch, $u_term ); $form->value( $aptitle, $u_title ); $form->value( $apdesc, $u_desc ); $form->value( $apurl, $u_url ); $form->value( $apbid, $u_bid ); The code works for setting the values on the other fields but bombs when trying to set the value of the hidden field. The error message returned is: No such field 'HTML::Form::TextInput=HASH(0x85d5f04)' at ./so.pl line 378 ================ The reason I'm trying to post to the hidden field is because I'm populating a form and then calling ->click and getting a response of is_succes is true. If I manually try to enter the same data in the form when I click on the submit button I get a javascript alert that after clicking OK sets the hidden value of the form to 'true' so that when I click the submit button again I don't get the alert. Since I can NOT change hidden form values how do I get around this annoying javascript alert? Any suggestions would be greatly appreciated. Thanks so much, Guy Davis | |
| |
| |
|
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: Perl HTML:Form ? How do I call the click method and avoid javascript alerts?
From: lexi-ga on 02 May 2002 15:01 PDT |
Is there some reason the form element needs to be hidden? Servers generally do not distinguish between the two types of fields, so if you can convince perl to treat it as a non-hidden field you should be okay. It seems like you could build a new form that contains all the same elements but does not mark any of them hidden. |
Subject:
Re: Perl HTML:Form ? How do I call the click method and avoid javascript alerts?
From: guysmiley-ga on 02 May 2002 15:20 PDT |
I'm looking into doing just that by looping through the fields using $form->inputs placed into a hash and using the HTTP::Request::Common with a Post the url and the hash. I should know if it's going to work shortly. |
Subject:
Re: Perl HTML:Form ? How do I call the click method and avoid javascript alerts?
From: guysmiley-ga on 02 May 2002 15:40 PDT |
I'm looking into doing just that by looping through the fields using $form->inputs placed into a hash and using the HTTP::Request::Common with a Post the url and the hash. I should know if it's going to work shortly. |
Subject:
Re: Perl HTML:Form ? How do I call the click method and avoid javascript alerts?
From: webadept-ga on 02 May 2002 17:34 PDT |
JavaScript runs in the browser, where as Perl is ran on the server and the output sent to the browser. You could look into using Perlscript (yes, it exists and can be used in a browser, but many don't support it) but this would be redundant to using the JavaScript. I'm afraid you are going to find that the answer to your question is "you can't" Of course everyday someone is doing something that someone else said is impossible. A good resource for finding the answer to this may be at perlmonks.com. There, several hundred Perl gurus will go over your question and the guy who make HTML::Form hangs out there as well. Good luck in your search. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |