Problem in input text with masking javascript

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
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
Lombardi
Posts: 1
Joined: Fri May 04, 2018 9:17 pm

Problem in input text with masking javascript

Post by Lombardi » Fri May 04, 2018 11:43 pm

Hello, excuse my English, therefore, I am using online translator.

When recording a macro the input text does not accept the csv information.

I've tried several recording methods and in none of them is the field filled - ie empty, blank.

Attempt 1:
-----------------
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_FORM_formView_PageControl_TIPO_TIPO_TIPO_1_CPFNUMERO_TEXTBOX CONTENT=___.___.___-__V


Attempt 2:
-----------------
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=NAME:ctl00$ctl03$defaultWebPartManager$GN_PESSOAS_FORM$formView$PageControl$TIPO$TIPO$TIPO$1$CPFNUMERO_TEXTBOX&&MAXLENGTH:20&&ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_FORM_formView_PageControl_TIPO_TIPO_TIPO_1_CPFNUMERO_TEXTBOX&&CLASS:form-control<SP>input-mask<SP>remove-incomplete-mask&&DATA-INPUTMASK:'mask':'999\\.999\\.999\\-99',<SP>'placeholder':'_'&&DATA-INPUTMASKPLACEHOLDER:_&&DATA-FIELD:CPFNUMERO&&DATA-TYPE:string&&DATA-LABEL:CPF&&TYPE:text CONTENT=___.___.___-__V

Note that in both attempts, at the end of the lines, the macro recording captures the letter "V" of the "ctrl + V" command and not the information that was pasted correctly in the input field.

When assigning variable {{! Col2}} or {{! Col3}} the field is not filled, I believe due to the javascript mask that appears in the above example "___.___.___-__".

In csv I put the same information in different columns in different formats, like the following examples:

Code: Select all

COD, CPF, CPF2
999, 123.456.789-00, 12345678900
888, 111,222,333-44, 11122233344
...
Another format with " "

Code: Select all

"COD", "CPF", "CPF2"
"999", "123.456.789-00", "12345678900"
"888", "111,222,333-44", "11122233344"
...
How do I input accept the information coming from csv?

Thanks for the help to follow the complete code.

Code: Select all

SET !DATASOURCE FF-INCLUI-CPF.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
SET !EXTRACT_TEST_POPUP NO 
SET !TIMEOUT_STEP 1
SET !ERRORIGNORE YES
ONERRORDIALOG BUTTON=YES CONTINUE=YES
ONWEBPAGEDIALOG KEYS={ENTER}
TAB T=1
WAIT SECONDS=4

'link
TAG POS=1 TYPE=A ATTR=TXT:Pessoas
WAIT SECONDS=4
'click to cleaner
TAG POS=1 TYPE=A ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_GRID_btn<SP>grey-silver
WAIT SECONDS=4

'input to find
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_GRID_FormView_GERAL_1__NOME_TEXTBOX CONTENT={{!COL1}}

'click to filter
TAG POS=1 TYPE=A ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_GRID_FilterButton
WAIT SECONDS=4

'click for edit
TAG POS=1 TYPE=I ATTR=ARIA-HIDDEN:true&&CLASS:fa<SP>fa-pencil&&TXT:
WAIT SECONDS=4

'click for select tab
TAG POS=1 TYPE=A ATTR=TXT:Tipo
WAIT SECONDS=4

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_FORM_formView_PageControl_TIPO_TIPO_TIPO_1_CPFNUMERO_TEXTBOX CONTENT=

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_FORM_formView_PageControl_TIPO_TIPO_TIPO_1_CPFNUMERO_TEXTBOX CONTENT={{!COL2}}
WAIT SECONDS=2

'click to desmark input
TAG POS=5 TYPE=DIV ATTR=TXT:CPF

'click to salve
TAG POS=2 TYPE=A ATTR=TXT:Salvar
WAIT SECONDS=4

'click link to reload page
TAG POS=3 TYPE=A ATTR=TXT:Pessoas
WAIT SECONDS=4

chivracq
Posts: 8195
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Problem in input text with masking javascript

Post by chivracq » Sat May 05, 2018 6:01 am

Lombardi wrote:Hello, excuse my English, therefore, I am using online translator.

When recording a macro the input text does not accept the csv information.

I've tried several recording methods and in none of them is the field filled - ie empty, blank.

Attempt 1:
-----------------

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_FORM_formView_PageControl_TIPO_TIPO_TIPO_1_CPFNUMERO_TEXTBOX CONTENT=___.___.___-__[b]V[/b]
Attempt 2:
-----------------

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=NAME:ctl00$ctl03$defaultWebPartManager$GN_PESSOAS_FORM$formView$PageControl$TIPO$TIPO$TIPO$1$CPFNUMERO_TEXTBOX&&MAXLENGTH:20&&ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_FORM_formView_PageControl_TIPO_TIPO_TIPO_1_CPFNUMERO_TEXTBOX&&CLASS:form-control<SP>input-mask<SP>remove-incomplete-mask&&DATA-INPUTMASK:'mask':'999\\.999\\.999\\-99',<SP>'placeholder':'_'&&DATA-INPUTMASKPLACEHOLDER:_&&DATA-FIELD:CPFNUMERO&&DATA-TYPE:string&&DATA-LABEL:CPF&&TYPE:text CONTENT=___.___.___-__[b]V[/b]
Note that in both attempts, at the end of the lines, the macro recording captures the letter "V" of the "ctrl + V" command and not the information that was pasted correctly in the input field.

When assigning variable {{! Col2}} or {{! Col3}} the field is not filled, I believe due to the javascript mask that appears in the above example "___.___.___-__".

In csv I put the same information in different columns in different formats, like the following examples:

Code: Select all

COD, CPF, CPF2
999, 123.456.789-00, 12345678900
888, 111,222,333-44, 11122233344
...
Another format with " "

Code: Select all

"COD", "CPF", "CPF2"
"999", "123.456.789-00", "12345678900"
"888", "111,222,333-44", "11122233344"
...
How do I input accept the information coming from csv?

Thanks for the help to follow the complete code.

Code: Select all

SET !DATASOURCE FF-INCLUI-CPF.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
SET !EXTRACT_TEST_POPUP NO 
SET !TIMEOUT_STEP 1
SET !ERRORIGNORE YES
ONERRORDIALOG BUTTON=YES CONTINUE=YES
ONWEBPAGEDIALOG KEYS={ENTER}
TAB T=1
WAIT SECONDS=4

'link
TAG POS=1 TYPE=A ATTR=TXT:Pessoas
WAIT SECONDS=4
'click to cleaner
TAG POS=1 TYPE=A ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_GRID_btn<SP>grey-silver
WAIT SECONDS=4

'input to find
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_GRID_FormView_GERAL_1__NOME_TEXTBOX CONTENT={{!COL1}}

'click to filter
TAG POS=1 TYPE=A ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_GRID_FilterButton
WAIT SECONDS=4

'click for edit
TAG POS=1 TYPE=I ATTR=ARIA-HIDDEN:true&&CLASS:fa<SP>fa-pencil&&TXT:
WAIT SECONDS=4

'click for select tab
TAG POS=1 TYPE=A ATTR=TXT:Tipo
WAIT SECONDS=4

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_FORM_formView_PageControl_TIPO_TIPO_TIPO_1_CPFNUMERO_TEXTBOX CONTENT=

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl03_defaultWebPartManager_GN_PESSOAS_FORM_formView_PageControl_TIPO_TIPO_TIPO_1_CPFNUMERO_TEXTBOX CONTENT={{!COL2}}
WAIT SECONDS=2

'click to desmark input
TAG POS=5 TYPE=DIV ATTR=TXT:CPF

'click to salve
TAG POS=2 TYPE=A ATTR=TXT:Salvar
WAIT SECONDS=4

'click link to reload page
TAG POS=3 TYPE=A ATTR=TXT:Pessoas
WAIT SECONDS=4
CIM...! :mrgreen:
Yeah, FCI not mentioned (read my Sig), wondering why you had to post in the FF Sub-Forum...!? (No need to duplicate now...)

But, OK, mention your FCI for me to read... 8)

Oh..., but hum, 5 years Experience on the Forum with Users starting their first Post on the Forum with "Hello, excuse my English, therefore, I am using online translator." is that they first have to learn and master English a bit correctly and come back to the Forum usually at least 2 years later... :idea:
=> OK, do your best, try to break the "Record"... 8)
(Hum, maybe now I understand why you didn't/couldn't read/understand/apply the Forum Rules, ah-ah...! :shock: )
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
Post Reply