BreCalmor 0 Posted October 21, 2010 Webpage form code: <form action="/servlet/quizquestioncreatorservlet" method="post" name="quizquestionform"> <input type="hidden" name="ed" value="new"/> <input type="hidden" name="question_id" value="null"/> <input type="hidden" name="ans_type_id" value="5"/> <input name="savecontinue" type="image" id="savecontinue" value="Save and Continue" src="/images/save_new.gif" width="100" height="30"/> <input name="savecomeback" type="image" id="savecomeback" value="Save go to list" src="/images/save_list.gif" width="100" height="30"/> <input name="cancel" type="image" id="cancel" value="Cancel" src="/images/cancel_list.gif" width="100" height="30"/> - a Bunch of textboxes, checkboxes, and radio buttons to select. <input name="savecontinue" type="image" id="savecontinue" value="Save and Continue" src="/images/save_new.gif" width="100" height="30"/> <input name="savecomeback" type="image" id="savecomeback" value="Save go to list" src="/images/save_list.gif" width="100" height="30"/> <input name="cancel" type="image" id="cancel" value="Cancel" src="/images/cancel_list.gif" width="100" height="30"/> </form> I tried: $oIE = _IECreate ($sWebSite, 0, 1, 1, 1) $oForm = _IEFormGetObjByName ($oIE, "quizquestionform") If $aExcel[$I+1][1] = "" Then ; Save the question and go to the next one _IEFormImageClick ($oForm, "Save and Continue", "alt", 0, 1) ;_IEImgClick ($oIE, "Save and Continue", "alt", 0, 1) _IEFormSubmit ($oForm) Else ; Save the question and go to the question list to finish the quiz _IEFormImageClick ($oForm, "Save go to list", "alt", 0, 1) ;_IEImgClick ($oIE, "Save go to list", "alt", 0, 1) _IEFormSubmit ($oForm) EndIf The IF works, but the ELSE doesn't... grrrr Thoughts? Bre Share this post Link to post Share on other sites
Syed23 5 Posted October 21, 2010 most of the times i too have a same problem with the "IF" condition. some times IF part will work or else both the IF and else part will work... But i will try to come up with the solution for you... Webpage form code: <form action="/servlet/quizquestioncreatorservlet" method="post" name="quizquestionform"> <input type="hidden" name="ed" value="new"/> <input type="hidden" name="question_id" value="null"/> <input type="hidden" name="ans_type_id" value="5"/> <input name="savecontinue" type="image" id="savecontinue" value="Save and Continue" src="/images/save_new.gif" width="100" height="30"/> <input name="savecomeback" type="image" id="savecomeback" value="Save go to list" src="/images/save_list.gif" width="100" height="30"/> <input name="cancel" type="image" id="cancel" value="Cancel" src="/images/cancel_list.gif" width="100" height="30"/> - a Bunch of textboxes, checkboxes, and radio buttons to select. <input name="savecontinue" type="image" id="savecontinue" value="Save and Continue" src="/images/save_new.gif" width="100" height="30"/> <input name="savecomeback" type="image" id="savecomeback" value="Save go to list" src="/images/save_list.gif" width="100" height="30"/> <input name="cancel" type="image" id="cancel" value="Cancel" src="/images/cancel_list.gif" width="100" height="30"/> </form> I tried: $oIE = _IECreate ($sWebSite, 0, 1, 1, 1) $oForm = _IEFormGetObjByName ($oIE, "quizquestionform") If $aExcel[$I+1][1] = "" Then ; Save the question and go to the next one _IEFormImageClick ($oForm, "Save and Continue", "alt", 0, 1) ;_IEImgClick ($oIE, "Save and Continue", "alt", 0, 1) _IEFormSubmit ($oForm) Else ; Save the question and go to the question list to finish the quiz _IEFormImageClick ($oForm, "Save go to list", "alt", 0, 1) ;_IEImgClick ($oIE, "Save go to list", "alt", 0, 1) _IEFormSubmit ($oForm) EndIf The IF works, but the ELSE doesn't... grrrr Thoughts? Bre Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font] Share this post Link to post Share on other sites
Syed23 5 Posted October 25, 2010 (edited) Brecalmor, I apologizes for the delay.... I had the same issue of "IF condition". when i use the if condition as a 10 line program it works perfect as I expected. But if i add the same code in 1000 line program then i am getting your issue. To avoid this issue i used an simple idea which worked for me. it's simple... i added my "If condition code" in to a function then i called the funtion from the respective place. It got worked for me... I hope i am making sense... Please let me know if you have any questions..... E.G: - $oIE = _IECreate ($sWebSite, 0, 1, 1, 1) $oForm = _IEFormGetObjByName ($oIE, "quizquestionform") Call ("Test") Func Test()If $aExcel[$I+1][1] = "" Then ; Save the question and go to the next one _IEFormImageClick ($oForm, "Save and Continue", "alt", 0, 1) ;_IEImgClick ($oIE, "Save and Continue", "alt", 0, 1) _IEFormSubmit ($oForm)Else ; Save the question and go to the question list to finish the quiz _IEFormImageClick ($oForm, "Save go to list", "alt", 0, 1) ;_IEImgClick ($oIE, "Save go to list", "alt", 0, 1) _IEFormSubmit ($oForm)EndIf EndFunc Edited October 25, 2010 by syedibrahim87 Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font] Share this post Link to post Share on other sites