marknt Posted September 28, 2006 Share Posted September 28, 2006 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.comNotice 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 :) Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted September 28, 2006 Share Posted September 28, 2006 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] Quote Link to comment Share on other sites More sharing options...
fenway Posted September 28, 2006 Share Posted September 28, 2006 In general, you should probably revert the button text after a certain time interval... often, the button is disabled as well onclic. Quote Link to comment Share on other sites More sharing options...
marknt Posted September 30, 2006 Author Share Posted September 30, 2006 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.