Javascript indexOf
<p>I'm not well clued up with javascript so I'm having a problem getting the following script to work. I need to check if a name entered is also contained within a message.</p>

<pre><code>&lt;input type="hidden" id="Message" value="&lt;%= rsDetail.Fields("Message") %&gt;"&gt;
&lt;input type="hidden" id="FirstName" value="&lt;%= rsDetail.Fields("FirstName")%&gt;"&gt;

&lt;script type="text/javascript"&gt;
&lt;!--
function NameCheck(){
var FirstName=document.getElementByID('FirstName');
var CardMessage=document.getElementByID('Message');
var aPosition = CardMessage.indexOf('FirstName');

if (aPosition == -1)
alert("Name Not In Message.");
}
--&gt;
&lt;/script&gt;

&lt;a href="NextPage.asp" onClick="NameCheck();"&gt;Proceed&lt;/a&gt;
</code></pre>
