javascript - Call a "document.pressed" action from the URL bar -


in legacy website, found this

<input type="image" id="quickpass" name="quickpass"  src="/images/quickpass.gif"  alt="quick pass" onclick="document.pressed=this.value" value="quickpass" /> 

inside of form

<form name="listform" method="post" onsubmit="return onsubmitform();" accept-charset="utf-8" >  

there javascript method catch onsubmitform() method

function onsubmitform(cblength) { //snip     else if (document.pressed == 'quickpass'){         //do stuff         return true;     } //snip } 

is there way trigger submit via quickpass through url bar? though javascript:(document.getelementbyid("quickpass").onclick()) work returns "undefined" (in chrome consol) , nothing in ie6 (where built run)

notes: did not write original code maintaining it. also, cannot re-write code make more url-bar-friendly because @ end of dev cycle , today last day on project. finally, code works quite as-is when buttons physically clicked (and has 5 years).

you're calling .onclick() method instead of .click() try

javascript:(document.getelementbyid("quickpass").click()) 

Comments