Jump to content

Archived

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

marknt

Button onClick/onSubmit the button's value will change.

Recommended Posts

Hello everyone. I have a problem with javascript. I want to change the value of my button when the form is submitted or the button is clicked. Like in www.myspace.com

Notice if you click the Login button in myspace.com, the button's value will change to "Logging In"

I've been googling it but all i get is wrong links.

Please help thanks in advance. More power PHPfreaks  :)

Share this post


Link to post
Share on other sites
You'll need to add the following into your submit button tag:
[code]onclick="this.value = 'Logging In...'"[/code]

Eg:
[code]<input type="submit" name="login_btn" value="Login" onclick="this.value = 'Logging In...'" />[/code]

Share this post


Link to post
Share on other sites
In general, you should probably revert the button text after a certain time interval... often, the button is disabled as well onclic.

Share this post


Link to post
Share on other sites
Ah ok thanks. After posting my question here in phpfreaks forum, i found out the answer to my question. Anyway thanks a lot sir fenway and sir wildteen88 for your help.

One of my dreams is to have a Zend PHP certification someday  ;D

Share this post


Link to post
Share on other sites

×

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.