Thanks for the suggestion.
I tried to print the current form after selecting it with the form number. Please see the output for the same.
$current_form = $mech->form_number(10);
print "Present value of $input_name: " . $mech->value('DMPName') . "\n
+";
print $mech->current_form->{innerHTML};
No elements found for form number 10 at D:\....
Present value of DMPName: Current Name
Can't use an undefined value as a HASH reference at D:\...
But by selecting a form other than form number 1 lets me to access elements of every forms in the webpage including the first form.
Please find the stripped down version of the HTML.
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DMP configration</title>
<meta http-equiv="pragma" content="nocache" />
<link href="../ormats.css" type="text/css" rel="stylesheet"/>
<script src="../config.js" type="text/javascript">
</script>
<style type="text/css">
.styleColorSpan {color: #CCCCCC}
.stylePositionTable {position:relative;top:5px;}
</style>
</head>
<!-- onLoad( ) -->
<!-- -->
<body class="scrollbar_black" bgColor=#000000 onload="onLoad(
)">
<table class="toptable" cellpadding="1" cellspacing="2" height="100%"
+width="100%" border="0">
<!-- <table class="toptable" cellpadding="1" width="100%" height="
+100%" border="0"> -->
<tr height="100%">
<td valign="top">
<table width="100%" align=top bgColor=#ffffff vAlign=top>
<tr width="100%" cellspacing="0" cellpadding="0">
<form action="/goform/formHandlerConfigureDMPName" method="pos
+t" onsubmit = "return validateDMPNameOnSubmit(this)">
<td width="5%"><img src="../invis.gif" alt="" width="50" heigh
+t="30"/></td>
<td width="45%">Digital Media Player Name:</td>
<td width="50%"><input type="text" name="DMPName" value="mmmmm
+mmm" maxlength="129"/> <input type="submit" value="Apply"/
+></td>
</form>
</tr>
<tr>
<form action="/goform/formHandlerConfigureActive" method="get"
+ onsubmit="return onSubmitActive('Warning: Incorrect parameters may c
+ause undesired behavior. To save the new setting, click Ok.')">
<td> </td>
<td>Active:</td>
<td><select id="oSelectActive" name="active"><option value="0"
+>0</option><option value="1">1</option><option value="2">2</option><o
+ption value="3">3</option></select> <input type="submit" v
+alue="Apply"/></td>
</form>
</tr>
<tr>
<form action="/goform/formHandlerConfigure" method="get">
<td> </td>
<td>choose Profile to be configured:</td>
<td><select id="oSelectChoose" name="Nr"><option value="1">1</
+option><option value="2">2</option><option value="3">3</option></sele
+ct> <input type="submit" value="Show"/></td></td>
</form>
</tr>
</table>
<fieldset>
<legend><span class="styleColorSpan"><b>Profile 1 </b></span><
+/legend>
<form action="/goform/formHandlerConfigureSettings" method="post"
+onsubmit="return onSubmit(this,'Please complete the red entry.','Warn
+ing: Incorrect parameters may cause undesired behavior. To save the n
+ew settings, click Ok.','0')">
<table width="100%" align=middle bgColor=#ffffff vAlign=top>
<tr width="100%" cellspacing="0" cellpadding="0">
<td width="5%"></td>
<td width="45%">Name:</td>
<td width="50%"><input type="text" name="Name" /></td>
</tr>
</table>
<fieldset>
<legend><span class="styleColorSpan"><b>Settings</b></span></l
+egend>
<table width="100%" align=middle bgColor=#ffffff vAlign=top>
<tr width="100%" cellspacing="0" cellpadding="0">
<td width="5%"><img src="../invis.gif" alt="" width="50" heigh
+t="30"/></td>
<td width="45%">Service Set:</td>
<script type="text/JavaScript">
var myVar_IfWired = "1";
if(myVar_IfWired != 0){
var myCounter = 0;
var myCounter1 = "10";
var aspgetstringval = "TEST1zirgtspghwqTEST2zirgtspghwqTES
+T3zirgtspghwqTEST4zirgtspghwqTEST5zirgtspghwq";
var mySplitResult = aspgetstringval.split("zirgtspghwq");
document.writeln('<td><select id="oSelectType" nam
+e="S" onchange="onSelectType()">');
document.writeln('<option value="NONE">Select Opti
+on</option>');
while(myCounter < myCounter1){
var webpagedisplay = mySplitResult[myCounter];
document.writeln('<option value="'+mySplitResult[m
+yCounter]+'">'+webpagedisplay+'</option>');
myCounter++;
}
document.writeln('<option value="MANUAL">CONFIGURE MANUALL
+Y</option>');
document.writeln('</select></td>');
}
function toggle2(id, link) {
var e = document.getElementById(id);
if (e.style.display == "") {
e.style.display = "none";
link.innerHTML = "<b> [+] ADVANCE SETTING </b>";
} else {
e.style.display = "";
link.innerHTML = "<b> [-] ADVANCE SETTING </b>";
}
}
</script>
</tr>
<tr>
<!--td> </td>
<td> Type:</td>
<td><select id="oSelectType" name="Sec" onchange="onSelectType
+()"><option value="NONE">No <option value="WEP">WEP<option value="WPA
+">WPA</select></td-->
</tr>
</table>
<span id="oSpanManualConfig">
<table width="100%" align=middle bgColor=#ffffff vAlign=top>
</table>
</span>
</fieldset>
<a href="#" class="styleColorSpan" onclick="toggle2('content', thi
+s)"><b>[+] ADVANCE SETTINGS</b></a>
<fieldset id="content" style="display:none" >
<legend><span class="styleColorSpan"><b> Advance Setting</b></
+span></legend>
<fieldset>
<legend><span class="styleColorSpan"><b>Pror</b></span></legen
+d>
<table width="100%" align=middle bgColor=#ffffff vAlign=top>
<tr>
<td> </td>
<td>ver Port:</td>
<td><input id="oTextProxy" type="text" name="Prox" value="" ma
+xlength="5" onKeyUp="onKeyUpText()"/></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><span class="styleColorSpan"><b>ngs</b></span></legend
+>
<table width="100%" align=middle bgColor=#ffffff vAlign=top>
<tr>
<td width="45%">Use DHCP:</td>
<td width="50%"><input id="oCheckboxDhcp" type="checkbox" name
+="DHCPt" value="" onclick="onClickCheckboxDhcp()"> DHCP</input></td>
</tr>
</table>
</fieldset>
</fieldset>
<table >
<tr width="100%" cellspacing="6" cellpadding="6">
<td width="50%"><input type="submit" name=button value="Apply"
+/></td>
</tr>
</table>
</form>
</fieldset>
</td>
</tr>
</table>
</body>
</html>
Hope this gives you much information to work around the problem. |