Jump to content

No Form Name


NSearch
 Share

Recommended Posts

Is there anyway to use $o_SearchForm = _IEFormGetObjByName ($oIE, "???") with the following source code? There is no form name. I am trying to send values to:

<input type="TEXT" name="first_nbr" size="15" maxlength="20" VALUE='' >

<input type=TEXT name="second_nbr" size="15" maxlength="9" VALUE='' >

<FORM METHOD="POST" ACTION="/servlet/Servlet" METHOD="POST">
       <INPUT TYPE="hidden" NAME="jsp_name" VALUE="Invoiced">
    <INPUT TYPE="HIDDEN" NAME="orig_country"
      VALUE='US' >
    <INPUT TYPE="HIDDEN" NAME="language"
      VALUE='english' >
    <INPUT TYPE="hidden" NAME="service_type" 
      VALUE='E' >
    <INPUT TYPE="hidden" NAME="pay_type" 
      VALUE='invoice' >
    <INPUT TYPE="hidden" NAME="request_type" 
      VALUE='NewReq' >

    <tr> 
      <td CLASS="pagesubheader2" align=left valign="top"> 
        <table BORDER=0 ALIGN=left CELLPADDING=0 CELLSPACING=0 WIDTH=461>
          <tr> 
            <td align=right height="23" valign="top" width="36%">
              <b>Service Type:</b> 
            </td>
            <td align=right height="23" valign="top" width="2%">&nbsp;</td>
            <td align=left height="23" valign="top" width="62%">
              <img src="/images/shared/picture.gif" alt="Blah">

            </td>
          </tr>
          <tr> 
            <td width="36%" height="31" valign="top" align="right">
              <b>First Number:</b>
            </td>
            <td width="2%" height="31" valign="middle" align="right">&nbsp;</td>
            <td width="62%" height="31" valign="top" align="left">
              <input type="TEXT" name="first_nbr" size="15" maxlength="20"
                VALUE='' >
              <BR>
              
              
              
            </td>
          </tr>
          <tr> 
            <td width="36%" align="right" valign="top">
              <b>&nbsp;Second Number:</b>
            </td>
            <td width="2%" align="right">&nbsp;</td>
            <td width="62%" align="left"> 
              <input type=TEXT name="second_nbr" size="15" maxlength="9"
                VALUE='' >
              (9 digits)
              <BR>
              
              
              
            </td>
          </tr>
          <tr align="center"> 
            <td width="36%">&nbsp;</td>
            <td>&nbsp;</td>
            <td align="left" width="62%"><br>
              <input type="SUBMIT" value="Send Request"><BR><BR>
            </td>
          </tr>
        </table>
      </td>
    </tr>
      <!-- row for note content -->
    <tr> 
      <td align="left"> 
        <img src="/images/shared/shared_dot_gray.gif" height="1" width="450" vspace="5"><br>
        <b class="subheader">Please note</b> <br>
        <ul>
            <li>See the terms and conditions in the current <A HREF='http://www.blah.com'>blah blah blah</A> for complete blah blah blah<br><br></li><li>blah blah blah<br><br></li>
            <li>blah blah blah</li>
        </ul>
      </td>
    </tr>
  </FORM>
Edited by NSearch
Link to comment
Share on other sites

Thank you for your reply. I am now getting the correct numbers entered into the input boxes by using the form index functions. I am now hung up on submitting the form. Can I submit by index?

i don't think so, but i believe if you're assigning the form to a variable, you can submit via variable too...

$theform = _IEFormGetObjByIndex($o_object, 1)
_IEFormSubmit($theform)

***edit*** too slow i guess, but i knew you'd figure it out so i didn't rush to get response in, and actually handled some work issues while typing my response...

Edited by cameronsdad
Link to comment
Share on other sites

I am not trying to select radio buttons. I am still having to use the second form index, but the problem I am having is that the names of the radio buttons are the same. The values are different. Can anyone help me to select the correct radio button. Thanks.

<input type="RADIO" name="service_type" value="E" 
                                  
                                >
                              </td>
                              <td width="269" align="left">
                                <img src="/images/shared/picture.gif" alt="Blah"> 
                              </td>
                            </tr>
                            <tr> 
                              <td align="left" height="25" width="24"> 
                                <input type="RADIO" name="service_type" value="G"
Edited by NSearch
Link to comment
Share on other sites

Thank you for your reply. I am now getting the correct numbers entered into the input boxes by using the form index functions. I am now hung up on submitting the form. Can I submit by index?

There is no way to "submit" by index, but you can "click" on an element you get a reference to by index. There is an example of this in reply 3.

Dale

@cameronsdad - thanks so much for jumping in on these questions. you've been adding a lot of value lately

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I am trying the following code, but I can not get the radio button to become selected.

_IELoadWait($oIE)
        $form_objects = _IEFormGetObjByIndex($oIE, 1)
        $o_service = _IEFormElementGetObjByName ($form_objects, "service_type")
        _IEFormElementSetValue ($o_service, "E")
Link to comment
Share on other sites

I am trying the following code, but I can not get the radio button to become selected.

_IELoadWait($oIE)
        $form_objects = _IEFormGetObjByIndex($oIE, 1)
        $o_service = _IEFormElementGetObjByName ($form_objects, "service_type")
        _IEFormElementSetValue ($o_service, "E")
Sorry, this is not as obvious as it seems. The "value" of a check or radio is what is returned by the form when it is submitted -- you cannot set the group to that value and have it checked. You need to use .checked instead on the specific element in the checkbox or radio button collection. Now I am making it sound harder than it is... there is an example in reply 3 of the IE.au3 topic This example opens the AutoIt forum search page and toggles the sortby radiobuttons. An identical technique can be used with checkboxes.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Dale, That worked great. One last hurdle and I am there. I have two submit buttons in the form, the form has no name and here is the source code for the submit buttons.

<td width="295" valign="top" align="left"> 
                                <input type="submit" name="NewReq" value="           Make a New Request           ">
                              </td>
                            </tr>
                            <tr> 
                              <td align="left" valign="top" width="295" height="36"> 
                                <input type="submit" name="StatusReq" value="Check Status of Existing Request">
                              </td>

I have tried

$form_objects = _IEFormGetObjByIndex($oIE, 1)
        _IEFormSubmit($form_objects)

But because there are two submit buttons, I believe it is hanging up. How can I focus on the correct one.

You and cameronsdad have been SO MUCH help!

Edited by NSearch
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...