Javascript Form Completion Not "Accepting"

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
computergecko
Posts: 1
Joined: Fri Sep 28, 2018 7:34 pm

Javascript Form Completion Not "Accepting"

Post by computergecko » Fri Sep 28, 2018 7:42 pm

I have a script that fills out a form. It works "perfectly" in that the form is filled out completely.

However, when I click on "next" it processes as if the form was not completed.

NOW.... If I click into the form field then press some keys like SPACE then BACKSPACE, everything is accepted.

So it seems like it needs to have some "real" keystrokes for it to work...

how do I get this into the code?

Code: Select all

var FillForm = "";
FillForm += "CODE:" + "\n";
FillForm += "SET !ERRORIGNORE YES" + "\n";
FillForm += "SET !TIMEOUT_PAGE 1" + "\n";
FillForm += "FRAME NAME=\"app-iframe\"" + "\n";

for (z=0;z<=5;z++)
{
FillForm += "TAG POS=" + TextBox_Position + " TYPE=INPUT:TEXT ATTR=ID:title-text-* CONTENT=\"" + Data[z] + "\"" +  "\n";
TextBox_Position++;
}
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Javascript Form Completion Not "Accepting"

Post by chivracq » Sat Sep 29, 2018 2:36 am

computergecko wrote:I have a script that fills out a form. It works "perfectly" in that the form is filled out completely.

However, when I click on "next" it processes as if the form was not completed.

NOW.... If I click into the form field then press some keys like SPACE then BACKSPACE, everything is accepted.

So it seems like it needs to have some "real" keystrokes for it to work...

how do I get this into the code?

Code: Select all

var FillForm = "";
FillForm += "CODE:" + "\n";
FillForm += "SET !ERRORIGNORE YES" + "\n";
FillForm += "SET !TIMEOUT_PAGE 1" + "\n";
FillForm += "FRAME NAME=\"app-iframe\"" + "\n";

for (z=0;z<=5;z++)
{
FillForm += "TAG POS=" + TextBox_Position + " TYPE=INPUT:TEXT ATTR=ID:title-text-* CONTENT=\"" + Data[z] + "\"" +  "\n";
TextBox_Position++;
}
CIM :mrgreen: !! (For me to read and have a look. read my Sig...! :roll: )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
access2vivek
Posts: 69
Joined: Wed Dec 20, 2017 10:00 am
Location: New Delhi, India
Contact:

Re: Javascript Form Completion Not "Accepting"

Post by access2vivek » Wed Nov 07, 2018 12:00 pm

computergecko wrote:I have a script that fills out a form. It works "perfectly" in that the form is filled out completely.

However, when I click on "next" it processes as if the form was not completed.

NOW.... If I click into the form field then press some keys like SPACE then BACKSPACE, everything is accepted.

So it seems like it needs to have some "real" keystrokes for it to work...

how do I get this into the code?

Code: Select all

var FillForm = "";
FillForm += "CODE:" + "\n";
FillForm += "SET !ERRORIGNORE YES" + "\n";
FillForm += "SET !TIMEOUT_PAGE 1" + "\n";
FillForm += "FRAME NAME=\"app-iframe\"" + "\n";

for (z=0;z<=5;z++)
{
FillForm += "TAG POS=" + TextBox_Position + " TYPE=INPUT:TEXT ATTR=ID:title-text-* CONTENT=\"" + Data[z] + "\"" +  "\n";
TextBox_Position++;
}
You can use the EVENT option that is available for iMacros. The for loop would look something like the following.

Code: Select all

for (z=0;z<=5;z++)
{
FillForm+="EVENTS TYPE=KEYPRESS SELECTOR=\"INPUT#title-text-*\" CHARS=\""+Data[z]+"\"\n";
TextBox_Position++;
}
Although I cannot guarantee that the above code would work properly since I don't have access to the page elements, you should think something along those lines.

I hope it helps :)
Robust iMacros development with quick turnaround time. Drop an email at "access2content@gmail.com" with your project details.
Post Reply