Jump to content

How to find a text box


 Share

Recommended Posts

Hi guys,

Hope this does not sound to stupid

I have a webpage that has 5 text boxes on it. I need to select a certain text box to put a value in it.

The problem i have is that all the boxes has the same name and color. It works if i send the tab command. Do you have any other suggestions how to do this?

This is what the input boxes HTML looks like

<input name="input[]" type="text" tabindex="1" value="" title="a1">

<input name="input[]" type="text" tabindex="2" value="" title="a2">

<input name="input[]" type="text" tabindex="3" value="" title="a3">

<input name="input[]" type="text" tabindex="4" value="" title="a4">

<input name="input[]" type="text" tabindex="5" value="" title="a5">

if i use this code it just selects the first text box. Any advice will be apreciated. Thanx

$oText = _IEFormElementGetObjByName ($oForm, "input[]")
_IEFormElementSetValue ($oText, "11")
Link to comment
Share on other sites

Simply add the "index" parameter on "_IEFormElementGetObjByName ($oForm, "input[]")"

For example:

For the 1st box:

$oText = _IEFormElementGetObjByName ($oForm, "input[]", 0)
_IEFormElementSetValue ($oText, "11")

For the 2nd box:

$oText = _IEFormElementGetObjByName ($oForm, "input[]",1)
_IEFormElementSetValue ($oText, "11")

For the 3rd box:

$oText = _IEFormElementGetObjByName ($oForm, "input[]",2)
_IEFormElementSetValue ($oText, "11")

Etc...

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