Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

Passing a text to parent window

Hi,

I have a parent page and a child page that I am passing a string from the child page to the parent page.

the problem is when the text has   '     my javascript will not work .


on the parent page I have 

  <textarea name="Headline" id="Headline" cols="8" rows="3"  style="vertical-align:top;width:600px;color:#555555; font-size:12px;"></textarea>

Open in new window


on the child page

	function SendValue(GetCQTicket,GetHeadLine)
		{
			window.parent.document.getElementById('CQTicketID').value = GetCQTicket;
			window.parent.document.getElementById('Headline').value = GetHeadLine;
			window.parent.$('#ViewFindTicketdialog:visible').dialog('close');			
		}


<SPAN onclick="SendValue('ent00116901','Add '0180 Leave of Absence' to the bed type drop down menu for BH UM cases.');" style="CURSOR: pointer; COLOR: #4a79a5">ent00116901</SPAN>

Note: the headline data has '  that's why my javascript is not working 

How can I pass the data correct  ?

Open in new window


Thank you
Lulu
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

You can escape the single quotes with a backslash.
<SPAN onclick="SendValue('ent00116901','Add \'0180 Leave of Absence\' to the bed type drop down menu for BH UM cases.');" style="CURSOR: pointer; COLOR: #4a79a5">ent00116901</SPAN>

Open in new window

Or you can use double quotes on the outside.
<SPAN onclick="SendValue('ent00116901',"Add '0180 Leave of Absence' to the bed type drop down menu for BH UM cases.");" style="CURSOR: pointer; COLOR: #4a79a5">ent00116901</SPAN>

Open in new window

Avatar of lulu50

ASKER

Tom,

I have no control of what the headline is going to be.

I can't change the data in the headline and I tried the " but it did not work.

onclick="SendValue('#CQticketSearchResult.id#','"'#CQticketSearchResult.Headline#'"');"
ASKER CERTIFIED SOLUTION
Avatar of lulu50
lulu50
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lulu50

ASKER

Found a solution to my string