473,218 Members | 1,481 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,218 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 2302
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:
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.