MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
Scripting can't call javascript function before submit form
Current time: 02-22-2020, 05:57 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting can't call javascript function before submit form
07-02-2010, 07:24 PM
Post: #1
Scripting can't call javascript function before submit form
I want to test my application by script, I wrote a script to login as below:

// load the account name and password
loadVariables accounts.txt

// bring up the login screen
setDOMElement name=user_id
navigate http://w3x32s05-pv010.pd.local

// log in
sleep 5
setValue name=user_id %ADMINISTRATOR%
setValue name=password %PASSWORD%
setDOMElement innerText=My Institution
sleep 5
submitForm name=login

It runs well but just couldn't login successfully.
After I debug code, I found the root reason is because the submitForm action won't run validate_form javascript funciton in my login page before submit(it will call the function if we submit it by manual).
my form is like this:
<form onsubmit="return validate_form( this, true );" method="POST" action="http://w3x32s05-pv010/webapps/login/" NAME="login" >
the validate_form javascript will encode the password by a token value, it means the encode password will change each time, I can't set the encode password value too.
Does it has any way I can write the script to login in my application? thanks.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Scripting can't call javascript function before submit form - wwtaotao - 07-02-2010 07:24 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)