Jump to content

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


marknt

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  :)
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]
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

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.