auto submit/click

Subscribe to auto submit/click 15 posts, 4 voices

jiguda Scriptwright

hi guys u all scrip writers doin a great job.

i want a script wre, in a form when a particular field is filled (say it b d last field in d form)
submit button is auto triggered n clicked

i guess it can b done right now i n using two diff scripts for it
autologin & shotcut binder

plz inform

jigudamehta@yahoo.com

 
w35l3y Scriptwright

what if the last input is a checkbox ?
you may check it or not.

 
jiguda Scriptwright

no no its no a check box it a drop down field
if u want to check d form out
site : http://irctc.co.in/
user name : shahatul10
password : 123456
on left hand side link "quick book"
i want to tigger "quick book" in that quick book form.
it should trigger as soon as payment option is selected.

 
w35l3y Scriptwright

document.evaluate('//select[@name="gatewayID"]', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.addEventListener('change',function(e)
{
	e.target.form.elements.namedItem('Submit').click();
}, false);

 
jiguda Scriptwright

2 errors prohibited this script from being saved

There were problems with the following fields:

* Name can't be blank
* Src Missing beginning of metadata header: // ==UserScript==

ALSO HOW TO LOAD THE SCRIPT GIVEN BY U THANX A LOT IGUESS ITS DONE.
JUST LET ME KNOW HOW TO ADD THIS SCRIPT TO MY FIREFOX

 
w35l3y Scriptwright

// ==UserScript==
// @name           IRCTC : Quick Book
// @namespace      http://gm.wesley.eti.br/irctc
// @description    Submits the form after the payment option be chosen
// @include        https://www.irctc.co.in/cgi-bin/bv60.dll/irctc/booking/quickBook.do?*
// ==/UserScript==

document.evaluate('//select[@name="gatewayID"]', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.addEventListener('change',function(e)
{
	e.target.form.elements.namedItem('Submit').click();
}, false);

 
Avindra Gool... Scriptwright

eew... why not:

// ==UserScript==
// @name           IRCTC : Quick Book
// @namespace      http://gm.wesley.eti.br/irctc
// @description    Submits the form after the payment option be chosen
// @include        https://www.irctc.co.in/cgi-bin/bv60.dll/irctc/booking/quickBook.do?*
// ==/UserScript==
document.evaluate('//select[@name="gatewayID"]', document, null, 9, null).singleNodeValue.addEventListener('change',function(e)
{
	e.target.form.elements.namedItem('Submit').click();
}, false);

?

The XPathResult types are really just integer constants. XPathResult.ANY_UNORDERED_NODE_TYPE is equal to 8. But I chose 9 since this is a singleNodeValue return type.

 
JoeSimmons Scriptwright

I'll help him with it guys.

 
jiguda Scriptwright

This style has problems that may prevent it from working:

Selector expected. Ruleset ignored due to bad selector.

Unexpected end of file while searching for closing } of invalid rule set.

Do you want to use this code anyway?

i still dont know how to install the script plz help

 
jiguda Scriptwright

ok now i managed to install both the above sctipts both seems working quit d same way, can u differentiate both
also one more thing i use fire form (firefox extension) to fill form can u guys plz do this much more, that when i fill form wid fire form the script is triggered the same way its triggering now.

other wise its working exactly the way i want.

thanx a lot.

is thre any thing by which v can do away with confirmation prompt "turn off confirmation prompt"

 
jiguda Scriptwright

also let me know if i want to submit a form wre last entry is a radio button

site : http://irctc.co.in/
user name : shahatul10
password : 123456

plann my travel page ( i want to click "find trains" as soon as i select " i ticket/e ticket"

 
JoeSimmons Scriptwright

Stop trying to install it to Stylish and install it to Greasemonkey.

 
w35l3y Scriptwright

both scripts works exactly the same way.
the difference is I like using named constants and @avg uses literals. named constants are self-documented.
teorically, XPathResult.FIRST_ORDERED_NODE_TYPE takes a little more time because it's ordered. This is why I use XPathResult.ANY_UNORDERED_NODE_TYPE.

change the line:

e.target.form.elements.namedItem('Submit').click();

to:
e.target.form.submit();

This will prevent from triggering the onclick event

 
Avindra Gool... Scriptwright

@w35l3y : If you're talking about speed, XPathResult.FIRST_ORDERED_NODE_TYPE is unquestionably faster, because rather than trying to resolve EVERYTHING it can (which is what XPathResult.ANY_UNORDERED_NODE_TYPE does), the first ordered node type result stops immediately after resolving the first element.

 
jiguda Scriptwright

e.target.form.submit();

Is not working
after installing it is shows "online reservation error" that means its triggering some other link.

also i want what if last item is a radio button. n if i can select a radio button b default, wre its not selected.

>>

also let me know if i want to submit a form wre last entry is a radio button

site : http://irctc.co.in/
user name : shahatul10
password : 123456

plann my travel page ( i want to click "find trains" as soon as i select " i ticket/e ticket"

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel