Page 1 of 1

Problems with speech marks

Posted: Thu Mar 18, 2010 8:02 am
by kdidymus
Folks.

This is driving me crazy. Hoping somebody may be able to help.

In short, I'm trying to implement some Javascript in my page which will allow a Textbox Watermark. The Javascript and CSS is written. All I need to do is add the HTML part of the code to my PHP. And this is where I've hit a stumbling block.

The following code works fine in HTML but won't work in my PHP because of the speech marks. If I swap out the speech marks and use apostrophes instead, the page generates errors.

Code: Select all

<input type='text' name='urn' [color=#FF0000]class="gatherZip" id="theTextBox" onblur="showWatermark('theTextBox')" onfocus="hideWatermark('theTextBox')"[/color]></input><input type='submit' name='submit' value='Jump!'></input>
Any idea how I can get this code to work? The section in red is the code I'm trying to add. The bits in black are from my existing PHP.

I've tried escaping the innermost apostrophes but it still doesn't work. Aargh!

Many, MANY thanks.

KD.

Re: Problems with speech marks

Posted: Thu Mar 18, 2010 8:32 am
by kdidymus
Solved it.

Just added a slash before the speech marks.

One word...

DOH!