Author Topic: Q: Automatically "press" a button on a form?  (Read 11170 times)

Moshi

  • Newbie
  • *
  • Posts: 2
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Q: Automatically "press" a button on a form?
« on: November 11, 2001, 02:28:05 PM »

Is there any way for Proxomitron to automatically "press" a button on a form? (example: simulate a click on the submit button for me)

(the form uses POST method and no Javascript)


Thanks


 
 

Arne

  • Administrator
  • Hero Member
  • *****
  • Posts: 778
    • ICQ Messenger - 1448105
    • AOL Instant Messenger - aflaaten
    • Yahoo Instant Messenger - arneflaa
    • View Profile
    • http://
    • Email
Q: Automatically "press" a button on a form?
« Reply #1 on: November 11, 2001, 02:51:36 PM »
Can you explain why this would be useful, please?


Best wishes
Arne
Imici username: Arne
Best wishes
Arne
Imici username= Arne

Moshi

  • Newbie
  • *
  • Posts: 2
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Q: Automatically "press" a button on a form?
« Reply #2 on: November 13, 2001, 01:49:01 PM »
Right now, I'm using Proxomitron to fill out some form values for me. (eg. login pages, preference pages) And I wanted Proxo to automatically submit it for me each time I visit the page.

(I'm not asking for a new feature, just asking if it's possible as is.)
 

Arne

  • Administrator
  • Hero Member
  • *****
  • Posts: 778
    • ICQ Messenger - 1448105
    • AOL Instant Messenger - aflaaten
    • Yahoo Instant Messenger - arneflaa
    • View Profile
    • http://
    • Email
Q: Automatically "press" a button on a form?
« Reply #3 on: November 13, 2001, 02:55:10 PM »
Now I get it. I will check around and see if there is one like you ask for, and also try to figure it out myself. Maybe it can be done with javascript - not sure yet.



Best wishes
Arne
Imici username: Arne
Best wishes
Arne
Imici username= Arne

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Q: Automatically "press" a button on a form?
« Reply #4 on: November 13, 2001, 05:04:19 PM »
Just a thought...

If you can write a filter that will capture the form name (as in <FORM NAME="myform">), you could use the filter to add this Javascript to the page:
<SCRIPT LANGUAGE="JavaScript"><!--
setTimeout('document.myForm.submit()',5000);
//--></SCRIPT>
Replace 5000 with the number of microseconds you want to have before submittal.
Note: this probably only works in Internet Explorer.

Unfortunately my attempts at writing this filter failed...

EDIT:
if the form does use the name myForm (I found many actually do!), you could use the filter below:

Name = "Form autosubmit - TESTING"
Active = TRUE
Limit = 1024
Match = "</form>"
Replace = "</form>
<script language="JavaScript"><!--
setTimeout 'document.myForm.submit()',5000);
//--></script>
"

Feel free to put a better version here

Edited by - Jor on 13 Nov 2001  17:07:40
 

sidki3003

  • Moderator
  • Sr. Member
  • *****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Q: Automatically "press" a button on a form?
« Reply #5 on: March 20, 2002, 10:20:51 PM »
Well you can give the form name manually!
Here is my login filter for the Windows Commander Board:

Name = "WinCom Form Filler"
Active = TRUE
URL = "home.no.net/wincmd/"
Limit = 2048
Match = "<form1"
        "name="username"2 name="cookielength" size="7" maxlength="4" value="360"3 name="passwrd"4 name="cookieneverexp" tabindex="4" checked"
        "5</form>"
Replace = "<form name="MyForm"1"
          "name="username" value="myusername"2 name="cookielength" size="7" maxlength="4" value="0"3 name="passwrd" value="mypassword"4 name="cookieneverexp" tabindex="4""
          "5</form>
<!--/setTimeout/--><script language="JavaScript"> setTimeout('document.MyForm.submit()',5000); </script>
"
          "$STOP()"

I know it's a little late for a reply


 
 

Arne

  • Administrator
  • Hero Member
  • *****
  • Posts: 778
    • ICQ Messenger - 1448105
    • AOL Instant Messenger - aflaaten
    • Yahoo Instant Messenger - arneflaa
    • View Profile
    • http://
    • Email
Q: Automatically "press" a button on a form?
« Reply #6 on: March 20, 2002, 10:34:16 PM »
Hi

Cool! It is never too late.



Best wishes
Arne
Imici username: Arne
Best wishes
Arne
Imici username= Arne

Bes

  • Newbie
  • *
  • Posts: 29
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Q: Automatically "press" a button on a form?
« Reply #7 on: June 15, 2002, 08:31:27 PM »
Well, When trying this filter on my page, I get a javascript error saying :

Error : Object doesn't support this property or method.
Code : 0

What could be the problem then ?

 
 

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Q: Automatically "press" a button on a form?
« Reply #8 on: June 15, 2002, 08:32:21 PM »
A few questions...

Which of the filters in this thread are you using?
What browser are you using? (And if using Opera, what is it set to ID as?)



Edited by - Jor on 15 Jun 2002  21:33:22
 

Bes

  • Newbie
  • *
  • Posts: 29
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Q: Automatically "press" a button on a form?
« Reply #9 on: June 15, 2002, 08:41:28 PM »
Well, this is the filter I use :

----
Name = "MoneyBalls - Click MyFavorites"
Active = TRUE
Multi = TRUE
URL = "moneyballs.com"
Bounds = "<input * >"
Limit = 17240
Match = "<input type="button" value="My favorites" onClick="fillballs()">"
Replace = "<input type="button" value="My favorites" onClick="fillballs()">
"
          "<script language="JavaScript"> setTimeout('fillballs()',2000);
</script>"
          "<script language="JavaScript"> setTimeout('document.ticket.submit()',5000); </script>
"
          "$STOP()"
----
The first part (setTimout ('fillballs......) is working perfectly.
but 5 secs later, when the setTimout ('document.ticket.submit....) part is started, the error pops up.

I'm using IE 6.0

P.S. This is the first line of the form :

<form action="http://moneyballs.com/cgi-bin/lotto/lotto.pl" method="POST" name="ticket" target="_self" onsubmit="return checkpicks()">


Edited by - Bes on 15 Jun 2002  22:03:09
 

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Q: Automatically "press" a button on a form?
« Reply #10 on: June 15, 2002, 09:19:11 PM »
Could you give me a direct link to the page with the form, or post the entire form code? I can't see without live test why it wouldn't work...

 
 

Bes

  • Newbie
  • *
  • Posts: 29
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Q: Automatically "press" a button on a form?
« Reply #11 on: June 15, 2002, 09:36:59 PM »
Hi Jor, to not clutter this thread with my problems, I've sent it by PM

 
 

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Q: Automatically "press" a button on a form?
« Reply #12 on: June 15, 2002, 10:22:40 PM »
I'm working on this filter, will get back to you if I find what causes it not to work

 
 

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Q: Automatically "press" a button on a form?
« Reply #13 on: June 16, 2002, 12:29:05 AM »
hi all guys,
here my suggestions.

1. try to write the script out of the form not in it. so a match and replace like:

Match = "<input type="button" value="My favorites" onClick="fillballs()">"
Replace = "<input type="button" value="My favorites" onClick="fillballs()">
"
"<script language="JavaScript"> setTimeout('fillballs()',2000);
</script>"
"<script language="JavaScript"> setTimeout('document.ticket.submit()',5000); </script>
"
"$STOP()"

could be replaced by:

Match = "<input type="button" value="My favorites" onClick="fillballs()">1</form>"
Replace = "<input type="button" value="My favorites" onClick="fillballs()">1</form>
"
"<script language="JavaScript"> setTimeout('fillballs()',2000);
</script>"
"<script language="JavaScript"> setTimeout('document.ticket.submit()',5000); </script>
"
"$STOP()"

note the 1</form> at the end!

as second suggestion, i think you could use also an array to bypass the name of the form, something like document.form[0].submit

i haven't worked on it, this is only what i'm thinking in this moment :)

regards,
altosax.

 
 

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Q: Automatically "press" a button on a form?
« Reply #14 on: June 16, 2002, 12:34:36 AM »
just thinking,

because you know the url, name of the form and the name of the function to be executed, why don't you simply add javascript at <end> without match anything?

Edited by - altosax on 16 Jun 2002  01:35:59