Help for Copy and Add Functionality

Discussions and Tech Support specific to the iMacros for Chrome extension.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
shazam
Posts: 1
Joined: Wed Dec 01, 2010 3:00 pm

Help for Copy and Add Functionality

Post by shazam » Wed Dec 01, 2010 3:06 pm

Hello,

I am trying to figure out how to copy 2 numbers from html, add them together and input them into a user inputed field. Here is what the source code has are the variables I need to use:

<input type='hidden' value='8' name='FirstNumber' id='FirstNumber'><input type='hidden' value='10' name='SecondNumber' id='SecondNumber'>8 + 10 = <input type='Text' name='SimpleMath' id='SimpleMath'>

So I know it needs to be put into:

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=ID:SimpleMath CONTENT=FirstNumber+SecondNumber ??


I seriously for the life of me can't figure out how to grab the firstnumber from the source code and then the second number and then add them together and have the output be placed into the SimpleMath field.

Thank you!
Tom, Tech Support
Posts: 3601
Joined: Mon May 31, 2010 4:59 pm

Re: Help for Copy and Add Functionality

Post by Tom, Tech Support » Thu Dec 09, 2010 3:12 pm

Hi Shazam,

Try the following:

Code: Select all

SET !EXTRACT_TEST_POPUP NO
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:FirstNumber EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:SecondNumber EXTRACT=TXT
SET !VAR2 {{!EXTRACT}}
SET !EXTRACT NULL
ADD !VAR3 {{!VAR1}}
ADD !VAR3 {{!VAR2}}
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:SimpleMath CONTENT={{!VAR3}}
Regards,

Tom, iMacros Support
Post Reply