Jump to content

Input - Image - Submit, oh my


Recommended Posts

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

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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..... Posted Image

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 by syedibrahim87

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...