For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > August 2006 > Form option button submission using IE









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Form option button submission using IE
Nashtrump

2006-08-31, 10:49 am

HI all

i have a piece of code that uses the Win32::IE::Mechanize to try and submit a form.

This form is activated using a option button:

the code from the website is:

<form name="bonavfrm" id="bonavfrm" action="/betting/index.asp" method="get">
<input type="hidden" name="sl" id="sl" value="" />
<input type="hidden" name="gi" id="gi" value="0" />
<select class="WCHhider" name="sltc" id="sltc" onchange="BN_Go(this)">
<option value="200252.2" selected="selected" >NFL Pre-Season Matches</option>
<option value="181347.2">Superbowl XLI</option>
<option value="199730.2">NFL Divisions</option>
<option value="199812.2">NFL Conferences</option>
<option value="199823.2">NFL Specials</option>
<option value="200587.2">NFL Regular Season Wins</option>
<option value="195431.2">CFL Grey Cup</option>
<option value="199096.2">NCAAF Championship</option>
<option value="149826.2">Next Events Off</option>
</select>
<select class="WCHhider" name="slmtc" id="slmtc" onchange="BN_Go(this)">
<option value="cpnmtc1.1" selected="selected" >Game Lines</option>
</select>
<select class="WCHhider" name="sle" id="sle" onchange="BN_Go(this)">
<option value="502053.2">Carolina Panthers @ Pittsburgh Steelers</option>
<option value="502054.2">New England Patriots @ New York Giants</option>
<option value="502055.2">St. Louis Rams @ Miami Dolphins</option>
<option value="502056.2">Buffalo Bills @ Detroit Lions</option>
<option value="502057.2">Jacksonville Jaguars @ Atlanta Falcons</option>
<option value="502058.2">Baltimore Ravens @ Washington Redskins</option>
<option value="502059.2">Tampa Bay Buccaneers @ Houston Texans</option>
<option value="502060.2">Minnesota Vikings @ Dallas Cowboys</option>
<option value="502061.2">Chicago Bears @ Cleveland Browns</option>
<option value="502062.2">New Orleans Saints @ Kansas City Chiefs</option>
<option value="502063.2">Denver Broncos @ Arizona Cardinals</option>
<option value="502064.2">Oakland Raiders @ Seattle Seahawks</option>
<option value="-1" selected="selected" > - All - </option>
</select>
<input type="submit" value="Go!" id="BNGo" name="BNGo" />
</form>


however im trying to submit it using this code:

$ie->submit_form(
form_name => 'bonavfrm' ,
fields => { 'sl' => '',
'gi' => '$num', 'sltc' => '$optiona',
$slc => '-1'
},
);
$ie->click_button( value => 'Go!' );


obviously i change the value of $slc depending on the name cause it changes on each page.

However each time i change the value of $optiona i expect to get a different result but i get the same result in my $data each time.

$data = $ie->content();

Anyone know why this is?

Am i missing something?

thanks in advance...

Nash
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com