a) Does form filling using www::Mechanize, more specifically the click_button function work if the form's such that on clicking, it goes to a javaScript??
b) I've heard many times that Mechanize can't handle JavaScript() but is there a solution to move to the next page for this particular source code: (It's a bit long, so I've pasted the essential part of it)
I kinda have to navigate to the next page using my script at the earliest, kindly reply as soon as possible. Thanks a ton.
function Search() { validateSearchChecks() // Added By Manoj on 23 Jul 2003 if ( (!document.frmSearchSubnet.rdNetworkAddress[0].checke +d) && (!document.frmSearchSubnet.rdNetworkAddress[1].checked) && (!do +cument.frmSearchSubnet.rdNetworkAddress[2].checked) ) { alert('Please select atleast one search criterion from + either\n* Network address\n* From - To\n* No of Bits Unallocated'); return false; } // Search with IP Address if ( (document.frmSearchSubnet.txtNetAddO1.value != "") || (do +cument.frmSearchSubnet.txtNetAddO2.value != "") || (document.frmSearc +hSubnet.txtNetAddO3.value != "") || (document.frmSearchSubnet.txtNetA +ddO4.value != "") || (document.frmSearchSubnet.txtSubnetBits.value != + "") || (document.frmSearchSubnet.rdNetworkAddress[0].checked)) { // First Octate if (!ValidateIP(document.frmSearchSubnet.txtNetAddO1)) { return false; } // Second Octate if (!ValidateIP(document.frmSearchSubnet.txtNetAddO2)) { return false; } // Third Octate if (!ValidateIP(document.frmSearchSubnet.txtNetAddO3)) { return false; } // Fourth Octate if (!ValidateIP(document.frmSearchSubnet.txtNetAddO4)) { return false; } // Subnet Bits if (!ValidateIP(document.frmSearchSubnet.txtSubnetBits)) { return false; } } // Search with FROM Address if ( (document.frmSearchSubnet.txtFromNetAddO1.value != "") || + (document.frmSearchSubnet.txtFromNetAddO2.value != "") || (document. +frmSearchSubnet.txtFromNetAddO3.value != "") || (document.frmSearchSu +bnet.txtFromNetAddO4.value != "") || (document.frmSearchSubnet.rdNetw +orkAddress[1].checked)) { // First From Octate if (!ValidateIP(document.frmSearchSubnet.txtFromNetAddO1)) + { return false; } // Second From Octate if (!ValidateIP(document.frmSearchSubnet.txtFromNetAddO2)) + { return false; } // Third From Octate if (!ValidateIP(document.frmSearchSubnet.txtFromNetAddO3)) + { return false; } // Fourth From Octate if (!ValidateIP(document.frmSearchSubnet.txtFromNetAddO4)) + { return false; } } // Search with TO Address if ( (document.frmSearchSubnet.txtToNetAddO1.value != "") || ( +document.frmSearchSubnet.txtToNetAddO2.value != "") || (document.frmS +earchSubnet.txtToNetAddO3.value != "") || (document.frmSearchSubnet.t +xtToNetAddO4.value != "") || (document.frmSearchSubnet.rdNetworkAddre +ss[1].checked) ) { // First To Octate if (!ValidateIP(document.frmSearchSubnet.txtToNetAddO1)) { return false; } // Second To Octate if (!ValidateIP(document.frmSearchSubnet.txtToNetAddO2)) { return false; } // Third To Octate if (!ValidateIP(document.frmSearchSubnet.txtToNetAddO3)) { return false; } // Fourth To Octate if (!ValidateIP(document.frmSearchSubnet.txtToNetAddO4)) { return false; } } // Changed By Manoj on 23 Jul 2003 // Search with No of Bits UnAllocated if ( (document.frmSearchSubnet.txtBitsUnallocated.value != + "") || (document.frmSearchSubnet.rdNetworkAddress[2].checked)) { //if (!ValidateIP(document.frmSearchSubnet.txtBitsUnal +located)) { if (document.frmSearchSubnet.txtBitsUnallocated.value +== "") { alert('Please enter no of Bits Unallocated'); document.frmSearchSubnet.txtBitsUnallocated.focus( +); return false; } else if ( isNaN(document.frmSearchSubnet.txtBitsUnallo +cated.value) || (document.frmSearchSubnet.txtBitsUnallocated.value.in +dexOf(" ") != -1) ) { alert('Invalid Number, Please enter Number between + 0 to 32'); document.frmSearchSubnet.txtBitsUnallocated.focus( +); return false; } else { if ( (parseFloat(document.frmSearchSubnet.txtBitsU +nallocated.value) < 0) || (parseFloat(document.frmSearchSubnet.txtBit +sUnallocated.value) > 32)) { alert('Please enter Number between 0 to 32'); document.frmSearchSubnet.txtBitsUnallocated.fo +cus(); return false; } } } document.frmSearchSubnet.action = "./IPAllocSubNets.asp"; document.frmSearchSubnet.submit(); } // THE ABOVE IS THE JAVASCRIPT SEARCH WHICH MATTERS TO THE FOLLOWING P +IECE OF THE SOURCE CODE WHERE THE BUTTON IS CLICKED <Form Name=frmSearchSubnet Method=Post Action="./IPAllocSearchSubnets. +asp"> // Here other form fields are described which are getting filled by th +e script except the following one which is a button named CmdSearch <TD valign="bottom"><img src="../images/bleftCurve.gif" width="5" bord +er="0"></TD> <TD width=25% height=25 valign="Middle" align=center nowrap> </T +D> <TD align=right valign="bottom"><img src="../images/bRightCurve.gif" w +idth="5" border="0"></TD> </TR> </TABLE> <Br> <Table Width=85% Align=Center border=0 cellspacing=1 cellpadding=1> <Tr> <Td Width=50% Align=Left> </Td> <Td Width=50% Align=Right> <Input Type=Button Name=CmdSearch Value="   +;Search >>" OnClick="javascript:Search();"> </Td> </Tr> </Table> </Center> <Input Type=Hidden Name=Filter Value=""> <Input Type=Hidden Name=SearchFilter Value=""> </Form> </BODY> </HTML>
In reply to NO CLICKABLE INPUT by Battle_Fury
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |