function Search() { validateSearchChecks() // Added By Manoj on 23 Jul 2003 if ( (!document.frmSearchSubnet.rdNetworkAddress[0].checked) && (!document.frmSearchSubnet.rdNetworkAddress[1].checked) && (!document.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 != "") || (document.frmSearchSubnet.txtNetAddO2.value != "") || (document.frmSearchSubnet.txtNetAddO3.value != "") || (document.frmSearchSubnet.txtNetAddO4.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.frmSearchSubnet.txtFromNetAddO4.value != "") || (document.frmSearchSubnet.rdNetworkAddress[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.frmSearchSubnet.txtToNetAddO3.value != "") || (document.frmSearchSubnet.txtToNetAddO4.value != "") || (document.frmSearchSubnet.rdNetworkAddress[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.txtBitsUnallocated)) { if (document.frmSearchSubnet.txtBitsUnallocated.value == "") { alert('Please enter no of Bits Unallocated'); document.frmSearchSubnet.txtBitsUnallocated.focus(); return false; } else if ( isNaN(document.frmSearchSubnet.txtBitsUnallocated.value) || (document.frmSearchSubnet.txtBitsUnallocated.value.indexOf(" ") != -1) ) { alert('Invalid Number, Please enter Number between 0 to 32'); document.frmSearchSubnet.txtBitsUnallocated.focus(); return false; } else { if ( (parseFloat(document.frmSearchSubnet.txtBitsUnallocated.value) < 0) || (parseFloat(document.frmSearchSubnet.txtBitsUnallocated.value) > 32)) { alert('Please enter Number between 0 to 32'); document.frmSearchSubnet.txtBitsUnallocated.focus(); return false; } } } document.frmSearchSubnet.action = "./IPAllocSubNets.asp"; document.frmSearchSubnet.submit(); } // THE ABOVE IS THE JAVASCRIPT SEARCH WHICH MATTERS TO THE FOLLOWING PIECE OF THE SOURCE CODE WHERE THE BUTTON IS CLICKED
// Here other form fields are described which are getting filled by the script except the following one which is a button named CmdSearch