473,326 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

quotations problem with echo("") command

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
Jul 17 '05 #1
2 2306
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.
Jul 17 '05 #2
>
<?php

Hey thanks a lot man this one here worked.
echo "onfocus=\"this.value='write something here'\""; I thought I tried that but apparently not.
Mucho Gracias

?>

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: fartsniff | last post by:
Hello all. Can someone help out ? I found this PHP code that works just fine, however, I am trying to put it back into its original Javascript form. I am still learning the syntax, etc. for...
3
by: Michael Flanagan | last post by:
Of course "echo" is working, but I've got a case where php doesn't seem to be sending out the result of an "echo." I'm probably doing something wrong, but I can't see it. I've got the following...
2
by: Jesse | last post by:
Whenever I write a line of code that uses quotation marks, such as.. <% foreach (merri.Data.dsMerri.AlbumDetailsRow dr in merri.Business.AllBusiness.ArtistAndAlbumByStyle("Children")) {%> I...
1
by: Ennio-Sr | last post by:
Hi all! I'm writing a script that presents the user with a numbered lines menu, each line corresponding to a <case n> which executes a psql command. As the psql-commands are very similar to each...
16
by: abc my vclass | last post by:
C# has VB's "with" command? I like VB's with command, why don't know C# has it or not?
9
by: Tristán White | last post by:
Hi I am very new to PHP - actually, this is my second day at it, as I've only recently started a new job last week. We're a charity. I have a "No input file selected" problem. A Google search...
6
by: sck10 | last post by:
Hello, Is there the equivalent of the "with" command in c#? protected void SetFocusControl(Control FocusControl) { System.Text.StringBuilder script = New System.Text.StringBuilder();...
1
by: naughtybynature | last post by:
<html> <head> <title>Search Questions</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $query = '';
21
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.