IETagEventByAttrib - Can I blank a value?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
djs
Junior Coder
Posts: 47
Joined: Sun Apr 29, 2012 4:21 pm

IETagEventByAttrib - Can I blank a value?

Post by djs » Thu Jun 19, 2014 6:21 am

I'm working on a project where I need to clear some fields on a webpage at times. I wanted to use IETagEventByAttrib, but I can't figure out how to clear an existing value. I can use it to set values, its much faster then IEFormFill, but I can't seem to get it to clear a value.

I assume this is because if you leave the value blank, it doesn't know what to do, no event, no value. I've tried using a value of {""} and setting a blank variable and using the variable, I just can't figure out how to clear that field. Should there be an event of 'FILL'?

If I open google.com, I can reproduce the problem with:

Code: Select all

//Sets value in google search field
IETagEventByAttrib>{"https://www.google.com/?gws_rd=ssl"},INPUT,name=q,,test me
//Want to clear value in search field, but nothing happens, value from above is still set
IETagEventByAttrib>{"https://www.google.com/?gws_rd=ssl"},INPUT,name=q,,
Dan

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: IETagEventByAttrib - Can I blank a value?

Post by Marcus Tettmar » Thu Jun 19, 2014 9:25 am

You're right. It currently won't set it if the value is empty string due to the way it also works for clicking/focusing. We need to improve on this. I've added it to the work list.

In the mean time use IEFormFill instead, or try UISetValue.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

djs
Junior Coder
Posts: 47
Joined: Sun Apr 29, 2012 4:21 pm

Re: IETagEventByAttrib - Can I blank a value?

Post by djs » Thu Jun 19, 2014 2:25 pm

Thanks Marcus. I thought I might just be doing something crazy.

The particular webpage I'm working on has several calculated fields based on another field I set. The only way to get the fields to calculate correctly is if they are blanked out on submission. If not blank, they stay on their current value (by design).

I can use IEFormFill, but on this page, the IETagEventByAttrib is significantly faster, not sure why and I don't see this everywhere. By significantly, I mean at least a second per value. With 6 fields to work with, on hundreds of iterations of pages, I'm trying to optimize some time.

Dan

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: IETagEventByAttrib - Can I blank a value?

Post by JRL » Thu Jun 19, 2014 4:09 pm

Not sure I understand the question but does this work for you?

Code: Select all

VBEval>chr(0),del

IETagEventByAttrib>{"https://www.google.com/?gws_rd=ssl"},INPUT,name=q,,test me
IETagEventByAttrib>{"https://www.google.com/?gws_rd=ssl"},INPUT,name=q,,%del%

djs
Junior Coder
Posts: 47
Joined: Sun Apr 29, 2012 4:21 pm

Re: IETagEventByAttrib - Can I blank a value?

Post by djs » Thu Jun 19, 2014 4:27 pm

Interesting solution. It works with google, I'll try it on the actual webpage later and make sure it gets through the validation.
Thanks for the unique way to do this.

Dan

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts