Jump to content

Javascript help with html button.


sphinx

Recommended Posts

Hello,

 

My current login button consists of:

 

<form method="post" action="">
<input type="password" name="pswd">
<input type="submit" onclick="this.disabled=true;return true;" name="login" value="Login">

 

Basicly, I want to achieve the following:

 

1: Submit in 5 seconds when clicked, not instantly.

2: Change the text on the button when clicked ie: Please wait..

3: Disable button once clicked, like I have already done.

 

Is this possible to fit into one?

 

Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/220669-javascript-help-with-html-button/
Share on other sites

You need to make a function that will be called when the button is clicked, for the 5 seconds you need to be waited, you can check here http://www.sean.co.uk/a/webdesign/javascriptdelay.shtm, for the button name, you can change it using the .value property and for disabling the button you can check here http://www.codetoad.com/javascript/enable_disable_form_element.asp, I recommend you to read about javascript.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.