G
Guest
I am trying to submit a form that requires hidden fields from another form
on the same page before being submitted the relevant html is: < <form
name="poxy_url_form" method="get" action="/index.php">
<input type="hidden" name="q" value="" id="url_input" />
<input type="hidden" name="hl" value="" />
</form>
<form name="poxy_settings_form" method="get" action="" onsubmit="return
submit_form();">
<table style="width: 100%">
<tr><td class="option" style="width: 20%">URL</td><td class="option"
style="width: 80%"> <input type="text" name="url" size="70" value=""
/></td></tr>
I have tried it with both $mech->submit("poxy_url_form") and
$mech->submit("poxy_settings_form"), the first passes the value but nothing
is submitted. The full code is:
#!/usr/bin/perl;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech->get("http://witchproxy.info");
$mech->form("poxy_url_form");
$mech->set_visible('poxy_url_form','http://news.google.com');
$mech->form("poxy_settings_form");
$mech->field('url','http://news.google.com');
print $mech->content();
############################################################################
#################
As seen from the print out it doesn't show any content from news.google.com
but just the content from the first url, meaning nothing was submitted to
the form
on the same page before being submitted the relevant html is: < <form
name="poxy_url_form" method="get" action="/index.php">
<input type="hidden" name="q" value="" id="url_input" />
<input type="hidden" name="hl" value="" />
</form>
<form name="poxy_settings_form" method="get" action="" onsubmit="return
submit_form();">
<table style="width: 100%">
<tr><td class="option" style="width: 20%">URL</td><td class="option"
style="width: 80%"> <input type="text" name="url" size="70" value=""
/></td></tr>
I have tried it with both $mech->submit("poxy_url_form") and
$mech->submit("poxy_settings_form"), the first passes the value but nothing
is submitted. The full code is:
#!/usr/bin/perl;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech->get("http://witchproxy.info");
$mech->form("poxy_url_form");
$mech->set_visible('poxy_url_form','http://news.google.com');
$mech->form("poxy_settings_form");
$mech->field('url','http://news.google.com');
print $mech->content();
############################################################################
#################
As seen from the print out it doesn't show any content from news.google.com
but just the content from the first url, meaning nothing was submitted to
the form