Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 7th, 2005, 11:55 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default unterminated string constant

<SCRIPT LANGUAGE="JavaScript">


function noEntry()
{
mt=document.form1.consultantid.value;
if ((mt.length<1)||(mt.substring(0,6)=="******")) {
alert("I'm sorry. A username is needed.");
document.form1.consultantid.focus();
return false;
}
mt=document.form1.fname.value;
if ((mt.length<1)||(mt.substring(0,6)=="******")) {
alert("I'm sorry. A first name is needed.");
document.form1.fname.focus();
return false;
}

mt=document.form1.lname.value;
if ((mt.length<1)||(mt.substring(0,6)=="******")) {
alert("I'm sorry. A surname is needed.");
document.form1.lname.focus();
return false;
}


else { return true; }
}
// End -->
</SCRIPT>

I get an error:

Line 102, Char 42.

My HTML
__________________________________________________ ______

<form name="form1" method="post" action="editadminuser3.asp" onsubmit="return noEntry()">
  <input name="agencyid" type="hidden" value="<%=agencyid%>">
  <input name="agencyname" type="hidden" value="<%=agencyname%>">
  <input name="edituser" type="hidden" value="<%=edituser%>">
<table width="100%" bgcolor="#ececec" border="0" bordercolor="#000000" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="16" bgcolor="#ECECEC" bordercolor="#ececec"><img src="images/top_lefbb.gif" width="16" height="16"></td>
    <td height="16" bgcolor="#ECECEC" background="images/top_midbb.gif" bordercolor="#ececec"><img src="images/top_midbb.gif" width="16" height="16"></td>
    <td width="24" bgcolor="#ECECEC"><img src="images/top_rigbb.gif" width="24" height="16"></td>
  </tr>
  <tr>
    <td width="16" background="images/cen_lef.gif"><img src="images/cen_lef.gif" width="16" height="11"></td>
    <td>
    <Table width="100%" border="1" bordercolor="#000000" align="center" cellpadding="0" cellspacing="0">
        <tr bgcolor="#006699" bordercolor="#000000">
        <Td colspan="7" align="left"><b><%=trim(rs("f_name"))%>&nbsp;<%=tr im(rs("l_name"))%> Details </b></td>
        </tr>
        <tr bgcolor="#ECECEC" bordercolor="#ececec">
            <td width="197" align="center">Username</td>
            <td width="195" align="center">FirstName</td>
            <td width="186" align="center">LastName</td>
            <td width="203" align="center">Password</td>
        </tr>
    <tr bgcolor="#ececec" bordercolor="#ececec">
      <td >
        <div align="center">
          <input type="text" name="consultantid" size=10 value="<%=trim(rs("username"))%>">
      </div></td>
      <td ><div align="center">
          <input type="text" name="fname" size=15 value="<%=trim(rs("f_name"))%>">
      </div></td>
      <td ><div align="center">
          <input type="text" name="lname" size=15 value="<%=trim(rs("l_name"))%>">
      </div></td>
      <td align="center">
        <input type="type" name="password" size=10 value="<%=trim(rs("password"))%>">
      </td>
    </tr>
    <tr bgcolor="#ececec" bordercolor="#ececec">
      <td colspan="5">
            &nbsp;Allow Administration Access &nbsp;&nbsp;&nbsp;
      <input type="checkbox" name="admin_access"
             <% if trim(rs("admin_access")) = "yes" then response.write(" checked")%>
             ></input></td>
    </tr>
<tr bordercolor="#ececec" bgcolor="#ececec">
         <td colspan="5"><div align="center">
         <input type="button" name="edit_user" value="Edit User" onmouseover="style.cursor='hand'" onclick="if (noEntry()){document.form1.submit();}'">
        &nbsp;&nbsp;&nbsp;&nbsp;
         <input type="button" name="back" value="Back" onmouseover="style.cursor='hand'" onclick="history.back();">
        &nbsp;&nbsp;&nbsp;&nbsp;

          </div></td>
        </tr>
    </table>
    </td>
    <td width="24" background="images/cen_rigBB.gif" bgcolor="#ECECEC"><img src="images/cen_rigBB.gif" width="24" height="11"></td>
  </tr>
  <tr bgcolor="#ECECEC">
    <td width="16" height="16"><img src="images/bot_lefbb.gif" width="16" height="16"></td>
    <td height="16" bgcolor="#ECECEC" background="images/bot_midbb.gif"><img src="images/bot_midbb.gif" width="16" height="16"></td>
    <td width="24" height="16" bgcolor="#ECECEC"><img src="images/bot_rigbb.gif" width="24" height="16"></td>
  </tr>
</table>

<p>&nbsp;</p>
</form>


www.crmpicco.co.uk
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old February 7th, 2005, 12:01 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

This looks suspicious, isn't there an extra single quote in near the end?
Code:
<input type="button" name="edit_user" value="Edit User" onmouseover="style.cursor='hand'" onclick="if (noEntry()){document.form1.submit();}'">
--

Joe (Microsoft MVP - XML)
 
Old February 7th, 2005, 12:10 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

yes, cheers joe.

www.crmpicco.co.uk





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unterminated string constant cnottingham Classic ASP Databases 8 October 28th, 2011 01:43 PM
Unterminated String Constant Apocolypse2005 Javascript 2 June 22nd, 2006 08:36 AM
unterminated string constant Stubby HTML Code Clinic 1 February 3rd, 2005 05:56 AM
Unterminated String Constant Ben Horne Javascript 7 October 21st, 2004 11:26 AM
Unterminated String Constant Ben Horne Javascript 2 April 9th, 2004 02:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.