Re: Submit name change
| From: | Jochem Maas | Date: | Mon, 02 May 2005 08:30:22 +0000 |
| Subject: | Re: Submit name change | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-214319@lists.php.net to get a copy of this message | ||
Anasta wrote:
I need this to change the value of the button 'sit in' to the name of a user --it doesnt work so anyone got any ideas or is what i am looking to do impossible.have you tried the psychic-javascript-gurus@example.com list? ;-) (with kudos to John Nichel for the original 'psychic-db' comment which still makes me laugh when I think about it)
Either the button name can show the username or a text field can change from blank to show the username when clicked. <FORM ACTION="<?=$PHP_SELF?>" METHOD="GET"> <INPUT TYPE="SUBMIT" VALUE="Sit in" onClick="JavaScript:showname('<?php echo $uname;?>');the "JavaScript" is a give away that this is not a php question, go to a javascript list (or maybe first try google) and ask them, don't forget to include the definition of showname(), without it nobody can tell you why _it_ doesn't work. btw: 1. from what I can tell what you want to do is far from impossible. 2. on the PHP side of things, you have to make sure that $uname does not contain any unescaped single-quotes before echoing it (if you want to be sure that you javascript will not throw an error due to a syntax error)
return true;"> </FORM>