This is a discussion on quotations problem with echo("") command within the PHP Language forums, part of the PHP Programming Forums category; Running php4.3.6 What i'm trying to do is exactly like the weather channell site when you click ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Running php4.3.6
What i'm trying to do is exactly like the weather channell site when you click in the zip code box the text dissapears and you are free to type your zip. I can make it work by using this command: onfocus="this.value=''" but i want to generate the string with php by using the echo("write something here"); command. Obviously the problem here is the double_quotes i need are screwing up the command.Have tried using special characters and adding slashes. which both work to a degree. The page doesn't bomb but the onfocus still doesn't function. wtf how do i make it work?? time is 6:31pm Central |
|
|||
|
brianj wrote:
> The page doesn't bomb but the onfocus > still doesn't function. wtf how do i make it work?? Disclaimer: I don't know JavaScript. Maybe you get more comprehensive answers in a JavaScript newsgroup. <?php echo 'onfocus="this.value=\'write something here\'"'; echo "onfocus=\"this.value='write something here'\""; $double_quote = '"'; $single_quote = "'"; echo 'onfocus=', $double_quote, 'this.value=', $single_quote, 'write something here', $single_quote, $double_quote; ?> -- Mail sent to my "From:" address is publicly readable at http://www.dodgeit.com/ == ** ## !! !! ## ** == TEXT-ONLY mail to the complete "Reply-To:" address ("My Name" <my@address>) may bypass the spam filter. I will answer all pertinent mails from a valid address. |