plainjoe
07-29-2003, 11:14 AM
I need to trim a variable and replace the apostophes. Can this be done?
Example: Scott O'Riley....becomes Scott O Riley
Here's the code I'm currently using....I'm having problems when I run into apostrophes like the example above. The trimAct2 is where I'm having the problem.
<SCRIPT LANGUAGE="JavaScript">
function submitForm()
{
document.theform.submit();
}
function trimAct(act)
{
var act2;
act2=act.substring(10,20);
return (act2);
}
function trimAct2(act5)
{
var act6;
act6=act5.substring(0,30);
return (act6);
}
function trimAct3(act7)
{
var act8;
act8=act7.substring(0,10);
return (act8);
}
</SCRIPT>
<HTML>
<HEAD>
<TITLE>
Show Topic Items
</TITLE>
</HEAD>
<BODY bgColor=white text=black vlink="red" link="blue" alink="navy" >
<a name="top"></a>
<FONT style="BACKGROUND-COLOR: navy" color=white size=4><CENTER>
<p>Click the links to
view a Quarterly Statement... </p>
</FONT>
<FONT style="BACKGROUND-COLOR: navy" size=4>
<p>
<font color="#FFFFFF" style="background-color: navy" size="2"><em><strong>To search for a specific
name </strong></em> </font>
</FONT>
<font color="#FFFFFF" style="background-color: navy" size="2"><em><strong>click
the EDIT menu, and then click FIND</strong></em></font></p>
<HR></FONT><A name=top></A>
<A href="#bottom" ><FONT size=2>Go to Bottom of the table... </FONT></A>
<TABLE BORDER=5 borderColor=gray bgcolor="#C0C0C0"><font size=3>
<tr><th> Contract # </th><th> Annuitant </th><th> Statement Date </th>
</tr>
[! BEGINHTMLTABLE Group=TopicAll Vars=TopicItemReportOut,TopicItemVersionOut,TopicItemSectionOut,TopicItemNumberPagesOut,TopicItemPag eOffsetOut]
[!COLUMN Field=TopicItemOut Link=showvaqstmt.html target="_blank" script=trimAct]
[!COLUMN Field=TopicItemSectionOut script=trimAct2]
[!COLUMN Field=TopicItemFormattedVersionOut script=trimAct3]
[!ENDHTMLTABLE ]
</TABLE>
</font>
<P align=center><A name=bottom></A><A href="#top" ><FONT size=2>Go to Top of Table</FONT><BR> </A></P>
</BODY>
</HTML>
Example: Scott O'Riley....becomes Scott O Riley
Here's the code I'm currently using....I'm having problems when I run into apostrophes like the example above. The trimAct2 is where I'm having the problem.
<SCRIPT LANGUAGE="JavaScript">
function submitForm()
{
document.theform.submit();
}
function trimAct(act)
{
var act2;
act2=act.substring(10,20);
return (act2);
}
function trimAct2(act5)
{
var act6;
act6=act5.substring(0,30);
return (act6);
}
function trimAct3(act7)
{
var act8;
act8=act7.substring(0,10);
return (act8);
}
</SCRIPT>
<HTML>
<HEAD>
<TITLE>
Show Topic Items
</TITLE>
</HEAD>
<BODY bgColor=white text=black vlink="red" link="blue" alink="navy" >
<a name="top"></a>
<FONT style="BACKGROUND-COLOR: navy" color=white size=4><CENTER>
<p>Click the links to
view a Quarterly Statement... </p>
</FONT>
<FONT style="BACKGROUND-COLOR: navy" size=4>
<p>
<font color="#FFFFFF" style="background-color: navy" size="2"><em><strong>To search for a specific
name </strong></em> </font>
</FONT>
<font color="#FFFFFF" style="background-color: navy" size="2"><em><strong>click
the EDIT menu, and then click FIND</strong></em></font></p>
<HR></FONT><A name=top></A>
<A href="#bottom" ><FONT size=2>Go to Bottom of the table... </FONT></A>
<TABLE BORDER=5 borderColor=gray bgcolor="#C0C0C0"><font size=3>
<tr><th> Contract # </th><th> Annuitant </th><th> Statement Date </th>
</tr>
[! BEGINHTMLTABLE Group=TopicAll Vars=TopicItemReportOut,TopicItemVersionOut,TopicItemSectionOut,TopicItemNumberPagesOut,TopicItemPag eOffsetOut]
[!COLUMN Field=TopicItemOut Link=showvaqstmt.html target="_blank" script=trimAct]
[!COLUMN Field=TopicItemSectionOut script=trimAct2]
[!COLUMN Field=TopicItemFormattedVersionOut script=trimAct3]
[!ENDHTMLTABLE ]
</TABLE>
</font>
<P align=center><A name=bottom></A><A href="#top" ><FONT size=2>Go to Top of Table</FONT><BR> </A></P>
</BODY>
</HTML>