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 Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Javascript Form Completion Not "Accepting"

by computergecko on Fri Sep 28, 2018 12: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++;
}
computergecko
 
Posts: 1
Joined: Fri Sep 28, 2018 12:34 pm

Re: Javascript Form Completion Not "Accepting"

by chivracq on Fri Sep 28, 2018 7:36 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++;
}

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...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Javascript Form Completion Not "Accepting"

by access2vivek on Wed Nov 07, 2018 5:00 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++;
}


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 :)
access2vivek
 
Posts: 35
Joined: Wed Dec 20, 2017 3:00 am


Return to iMacros for Firefox

Who is online

Users browsing this forum: No registered users and 11 guests

-->