coldskool
12-03-2006, 09:18 AM
Hi All,
New user here.. I have a question on how to pass values to my javascript function.
I have this button:
<input type="button" value="Login" Onclick="DoLogin(this.value)"/>
But how would I pass the value of two other text fields instead of passing the value of the button? For instance If my form was:
<input type="text" name="username" />
<input type="password" name="password"/>
<input type="button" value="Login" Onclick="DoLogin(What do I put here?)"/>
And also, what about the function itself, currently it reads:
function DoLogin(str)
How should the function get these values Im passing in?
Thanks!
New user here.. I have a question on how to pass values to my javascript function.
I have this button:
<input type="button" value="Login" Onclick="DoLogin(this.value)"/>
But how would I pass the value of two other text fields instead of passing the value of the button? For instance If my form was:
<input type="text" name="username" />
<input type="password" name="password"/>
<input type="button" value="Login" Onclick="DoLogin(What do I put here?)"/>
And also, what about the function itself, currently it reads:
function DoLogin(str)
How should the function get these values Im passing in?
Thanks!