This may be obvious to someone. I am trying to place a textbox on the screen under a specific circumstance and I am using the following code:
document.getElementById('tbDetails').innerHTML = '<textarea name="taComments" style="height:40px;width:333px" class="f1 greytext" onblur="sb_textarea_onblur(this, \'Check Out Rhapsody Tours\'s Video:\')" onfocus="sb_textarea_onfocus(this, \'Check Out Rhapsody Tours\'s Video:\')">Check Out Rhapsody Tours's Video:</textarea>';
as you can see the text has a apostrophe "Check Out Rhapsody Tours's Video:" which is causing an error. The text is created dynamically in classic asp so there is no way to tell which information will be displayed.
Other code that may help:
function sb_textarea_onfocus(txt,defaultText)
{
if(txt&&txt.value == defaultText)
{
txt.value = '';
txt.className = 'f1';
}
}
function sb_textarea_onblur(txt,defaultText)
{
if(txt&&txt.value == '')
{
txt.value = defaultText;
txt.className = 'f1 greytext';
}
}
I just need a way to correct the javascript to allow apostrophes... Any idea..
Many thanks in advance, Paul