Help - Search - Members - Calendar
Full Version: PHP Echo Problem
Invision Power Services > Community Forums > Community Web Design and Coding
Michael P
I want to have a login form, which has a onfocus="this.value=''" thingy so that the field empties on click, my problem is that the Echo starts with Echo (" then to add " into it ends the echo and messes it up, since the onfocus has both " and ' in them im stumped, can you help me,

cheers

Michael
Michael P
Nevermind...
I have discovered the ESCAPE CHARACTER yey!
Kenny Pollock
Yep, adding \ before the " would escape the added ".
VoyagerUK
Or use apostrophes:

echo 'onfocus="this.value=''';

original.gif
Michael P
QUOTE
Or use apostrophes:

echo 'onfocus="this.value=''';


That wouldnt work because it is 'onfocus="this.value=''"'

apost. to open echo, quote to open this.value apost. to open the value (which thus closes echo) apost. to end value, quote to end this.onfocus and an apost. to end the echo.

So only the escape characted will work
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.