Re: Problem filling an input box that has onFocus="clearForm()" (106 Views)
Reply
Occasional Advisor
fafafooey
Posts: 13
Registered: ‎01-16-2014
Message 1 of 3 (155 Views)

Problem filling an input box that has onFocus="clearForm()"

I'm using descriptive programming to fill a search field and submit it. The value comes out of a dataTable. Mostly what occurs when the script runs is the placeholder text 'Search' vanishes and the value I want to have in there does not get added. It remains blank.

 

I suspect the clearForm in the field's properties is intefering.

I tried putting a line before filling in the value with just .Click to see if that would prepare the field for my value, but no go.

 

Here is the input box:

 

<input type="text" id="searchText" name="searchText" value="Search" onkeypress="javascript&colon;submitEnter(event);" onFocus="clearForm('searchText');"/>

 

Here is what I have to add my value:

Browser("Browser").Page("Page").WebEdit("searchText").Set DataTable("prodName", dtLocalSheet)
Browser("Browser").Page("Page").WebEdit("searchText").Image("go").Click

 

Anyone know how to get around this?

 

Occasional Advisor
fafafooey
Posts: 13
Registered: ‎01-16-2014
Message 2 of 3 (153 Views)

Re: Problem filling an input box that has onFocus="clearForm()"

the board stripped the colon between 'javascript' 'submitEnter...' when I posted the question :(
Occasional Advisor
fafafooey
Posts: 13
Registered: ‎01-16-2014
Message 3 of 3 (106 Views)

Re: Problem filling an input box that has onFocus="clearForm()"

Got it, thanks!

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.