in reply to Re^3: WIN32::IE::Mechanize - can't follow link - JavaScript involved
in thread WIN32::IE::Mechanize - can't follow link - JavaScript involved
Okay, I followed the JavaScipt script that looked like it would be the right one and I think it is. Here is the content. You can see that it includes the JSubmitForm() function call that appears in the "go2" button (that isn't a button!?).
browserName = navigator.appName; browserVer = parseInt(navigator.appVersion); if ((browserName == "Netscape" && browserVer >= 3) || (browserName == "Microsoft Internet Explorer" && browserVer >= + 4)) { version = "n3"; } else { version = "n2"; } if (version == "n3") { go_on = new Image; go_on.src = "/IAPD/Images/go_on.gif"; go_off = new Image; go_off.src = "/IAPD/Images/go_off.gif"; go2_on = new Image; go2_on.src = "/IAPD/Images/go_on.gif"; go2_off = new Image; go2_off.src = "/IAPD/Images/go_off.gif"; go3_on = new Image; go3_on.src = "/IAPD/Images/go_on.gif"; go3_off = new Image; go3_off.src = "/IAPD/Images/go_off.gif"; } /********************************************************************* +********* * Function: * JImgAct * * Purpose: * This function is called to activate an image. * ********************************************************************** +********/ function JImgAct(imgName) { if (version == "n3") { imgOn = eval(imgName + "_on.src"); document [imgName].src = imgOn; } } /********************************************************************* +********* * Function: * JImgInact * * Purpose: * This function is called to inactivate an image. * ********************************************************************** +********/ function JImgInact(imgName) { if (version == "n3") { imgOff = eval(imgName + "_off.src"); document [imgName].src = imgOff; } } function JSubmitForm() { document.Content.Name.value = document.Search1.Name.value; document.Content.CrdNumber.value = document.Search2.CrdNumber.valu +e; document.Content.SecNumber.value = document.Search3.SecNumber.valu +e; if (eval("document.Search1.SearchType[0].checked") == true) { document.Content.SearchType.value = 1; } if (eval("document.Search1.SearchType[1].checked") == true) { document.Content.SearchType.value = 2; } if (eval("document.Search1.SearchType[2].checked") == true) { document.Content.SearchType.value = 3; } if (eval("document.Search4.NumRows[0].selected") == true) { document.Content.NumRows.value = document.Search4.NumRows[0].v +alue; } if (eval("document.Search4.NumRows[1].selected") == true) { document.Content.NumRows.value = document.Search4.NumRows[1].v +alue; } if (eval("document.Search4.NumRows[2].selected") == true) { document.Content.NumRows.value = document.Search4.NumRows[2].v +alue; } if (eval("document.Search4.NumRows[3].selected") == true) { document.Content.NumRows.value = document.Search4.NumRows[3].v +alue; } document.Content.submit(); return false; }
With the JS code in hand, how do I attack my original problem of getting the form to submit? Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: WIN32::IE::Mechanize - can't follow link - JavaScript involved
by psini (Deacon) on May 22, 2008 at 19:01 UTC | |
by Ninth Prince (Acolyte) on May 22, 2008 at 20:32 UTC |