Javascript Form Completion Not "Accepting"

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
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: 8140
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)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...
access2vivek
Posts: 36
Joined: Wed Dec 20, 2017 10:00 am

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 :)
Post Reply