Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 9th, 2005, 07:19 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
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 How to check for empty fields in a form.

How to check for empty fields in a form.

__________________________________________________ __

<script language="javascript">
function valid(df)
{
// CRM_removed_20jan05
//if (df.pubfares.checked==false)
// {
// df.pubfares.value="no"
// }
// {
// df.pubfares.value="yes"
// }

df = document.form

if ((df.agency_name.value=="")||(df.agency_name.value .charAt(0)==" "))

    {
    alert("Please enter the Agency Name")
    df.agency_name.focus();
    df.agency_name.select();
    return false;
    }

if ((df.address.value=="")||(df.address.value.charAt( 0)==" "))

    {
    alert("Please enter the Address")
    df.address.focus();
    df.address.select();
    return false;
    }

if ((df.town_city.value=="")||(df.town_city.value.cha rAt(0)==" "))

    {
    alert("Please enter the Town or City")
    df.town_city.focus();
    df.town_city.select();
    return false;
    }

if ((df.postcode.value=="")||(df.postcode.value.charA t(0)==" "))

    {
    alert("Please enter Postcode")
    df.postcode.focus();
    df.postcode.select();
    return false;
    }

if ((df.tel_no.value=="")||(df.tel_no.value.charAt(0) ==" "))

    {
    alert("Please enter the Telephone Number")
    df.tel_no.focus();
    df.tel_no.select();
    return false;
    }

if ((df.main_contact.value=="")||(df.main_contact.val ue.charAt(0)==" "))

    {
    alert("Please enter the Main Contact")
    df.main_contact.focus();
    df.main_contact.select();
    return false;
    }

if ((df.email.value=="")||(df.email.value.charAt(0)== " "))

    {
    alert("Please enter the email address")
    df.email.focus();
    df.email.select();
    return false;
    }

if ((df.mas_con_id.value=="")||(df.mas_con_id.value.c harAt(0)==" "))

    {
    alert("Please enter the Master Consultant ID")
    df.mas_con_id.focus();
    df.mas_con_id.select();
    return false;
    }

if ((df.mas_passwd.value=="")||(df.mas_passwd.value.c harAt(0)==" "))

    {
    alert("Please enter the Master Password")
    df.mas_passwd.focus();
    df.mas_passwd.select();
    return false;
    }

var Email=df.email.value;
    if((Email.indexOf("@")==-1)||(Email.indexOf(".")==-1))
        {
        alert("please enter valid email Address");
        df.email.focus();
        df.email.select();
        return false;
        }

}
</script>


www.crmpicco.co.uk
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
Reply With Quote
  #2 (permalink)  
Old February 9th, 2005, 10:09 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi crmpicco!!
you can use this function to trim spaces and return the string.
function Trim(obj)
{
return (obj.value).replace(/^\s+/,"").replace(/\s+$/,"") ;
}

now you can check like
df = document.form

if(Trim(df.main_contact.value).length!=0)
{
 alert("Please enter the Main Contact")
    df.main_contact.focus();
    df.main_contact.select();
    return false;
    }


Cheers :)

vinod
Reply With Quote
  #3 (permalink)  
Old February 9th, 2005, 10:34 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
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

That doesnt work:

if (trim(df.main_contact.value=="")||(df.main_contact .value.charAt(0)==" "))

    {
    alert("Please enter the Main Contact")
    df.main_contact.focus();
    df.main_contact.select();
    return false;
    }


www.crmpicco.co.uk
Reply With Quote
  #4 (permalink)  
Old February 9th, 2005, 10:59 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi crmpicco !!!

there is no function in javascript like trim

<script>
function Trim(obj)
{
return (obj.value).replace(/^\s+/,"").replace(/\s+$/,"") ;
}
</script>

If you seed my answer then there is a function that i have defined :)
Hope this will help you


Cheers :)

vinod
Reply With Quote
  #5 (permalink)  
Old February 9th, 2005, 11:13 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
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

i have your trim function inside my script tags, but it doesnt work.

<script>
function Trim(obj)
{
return (obj.value).replace(/^\s+/,"").replace(/\s+$/,"") ;
}
</script>


if (trim(df.main_contact.value=="")||(df.main_contact .value.charAt(0)==" "))

    {
    alert("Please enter the Main Contact")
    df.main_contact.focus();
    df.main_contact.select();
    return false;
    }


www.crmpicco.co.uk
Reply With Quote
  #6 (permalink)  
Old February 9th, 2005, 11:14 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
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

My ENTIRE Code:

__________________________________________________ ___________________


<% ' Last Edit: CRM_09feb05 %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Picco: Add Agent</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
function Trim(obj)
{
return (obj.value).replace(/^\s+/,"").replace(/\s+$/,"") ;
}

function valid(df)
{
// CRM_removed_20jan05
//if (df.pubfares.checked==false)
// {
// df.pubfares.value="no"
// }
// {
// df.pubfares.value="yes"
// }

df = document.form

if ((df.agency_name.value=="")||(df.agency_name.value .charAt(0)==" "))

    {
    alert("Please enter the Agency Name")
    df.agency_name.focus();
    df.agency_name.select();
    return false;
    }

if ((df.address.value=="")||(df.address.value.charAt( 0)==" "))

    {
    alert("Please enter the Address")
    df.address.focus();
    df.address.select();
    return false;
    }

if ((df.town_city.value=="")||(df.town_city.value.cha rAt(0)==" "))

    {
    alert("Please enter the Town or City")
    df.town_city.focus();
    df.town_city.select();
    return false;
    }

if ((df.postcode.value=="")||(df.postcode.value.charA t(0)==" "))

    {
    alert("Please enter Postcode")
    df.postcode.focus();
    df.postcode.select();
    return false;
    }

if ((df.tel_no.value=="")||(df.tel_no.value.charAt(0) ==" "))

    {
    alert("Please enter the Telephone Number")
    df.tel_no.focus();
    df.tel_no.select();
    return false;
    }

if ((df.main_contact.value=="")||(df.main_contact.val ue.charAt(0)==" "))

    {
    alert("Please enter the Main Contact")
    df.main_contact.focus();
    df.main_contact.select();
    return false;
    }

if ((df.email.value=="")||(df.email.value.charAt(0)== " "))

    {
    alert("Please enter the email address")
    df.email.focus();
    df.email.select();
    return false;
    }

if ((df.mas_con_id.value=="")||(df.mas_con_id.value.c harAt(0)==" "))

    {
    alert("Please enter the Master Consultant ID")
    df.mas_con_id.focus();
    df.mas_con_id.select();
    return false;
    }

if ((df.mas_passwd.value=="")||(df.mas_passwd.value.c harAt(0)==" "))

    {
    alert("Please enter the Master Password")
    df.mas_passwd.focus();
    df.mas_passwd.select();
    return false;
    }

var Email=df.email.value;
    if((Email.indexOf("@")==-1)||(Email.indexOf(".")==-1))
        {
        alert("Please enter valid email Address");
        df.email.focus();
        df.email.select();
        return false;
        }

}
</script>
</head>

<body bgcolor="#f5f5f5">
<form name="form" onSubmit="return valid();">
<table width="550" bgcolor="#ECECEC" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
    <td width="16" bgcolor="#ECECEC"><img src="images/top_lefbb.gif" width="16" height="16"></td>
    <td height="16" bgcolor="#ECECEC" background="images/top_midbb.gif"><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="#666666" align="center" cellpadding="0" cellspacing="1">

            <tr bgcolor="#006699" bordercolor="#000000" border="1"><Td colspan="3" align="Left"><span class="style1"><strong>Add Agent</strong></span></td>
         </tr>

            <tr>
             <td height="25" colspan="3" align="center" bordercolor="#ececec" border="0">
             Please Enter the Agent's details below
             </td>
         </tr>
            <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0">&nbsp;</td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;</td>
         </tr>
            <tr>
             <td width="43%" height="25" align="right" bordercolor="#ececec" border="0">
             Agency Name&nbsp;
             </td>
             <td width="5%" align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td width="52%" height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="agency_name" id="agency_name" size="25">
             </td>
         </tr>
            <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Address&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
                <input type="text" name="address" id="address" size="25"></td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             &nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0">&nbsp;</td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
                <input type="text" name="address2" id="address2" size="25"></td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             &nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0">&nbsp;</td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
                <input type="text" name="address3" id="address3" size="25"></td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Town / City&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
                <input type="text" name="town_city" id="town_city"></td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Postcode&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
                <input type="text" name="postcode" id="postcode" size="10"></td>
         </tr>
             <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Telephone Number&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="tel_no" id="tel_no" size="15">
             </td>
         </tr>
            <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Main Contact&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="main_contact" id="main_contact" size="25">
             </td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Email Address&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="email" id="email" size="25">
             </td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Published Fares&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0">&nbsp;</td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
            
             Yes<input type="radio" name="pub_fares" id="pub_fares" value="yes">
             No<input type="radio" name="pub_fares" id="pub_fares" value="no">
            
             </td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Master Consultant ID&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="mas_con_id" id="mas_con_id">
             </td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Master Password&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="mas_passwd" id="mas_passwd">
             </td>
         </tr>
         <%
         'forename = this.form.forename.value
         'response.write "Forename = " & forename & "<br>"
         %>
            <tr>
             <td height="25" colspan="3" align="center" bordercolor="#ececec" border="0">&nbsp;</td>
         </tr>
            <tr>
             <td height="25" colspan="3" align="center" bordercolor="#ececec" border="0">
             <input type="submit" name="submit" id="submit" value="Submit" onMouseOver="style.cursor='hand'">&nbsp;&nbsp;
             <input type="button" name="back" id="back" value="Back" onMouseOver="style.cursor='hand'" onClick="history.back()">
             </td>
            
         </tr>
            <tr><td height="25" colspan="3" align="center" bordercolor="#ececec" border="0">&nbsp;</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>
</form>
</body>
</html>



www.crmpicco.co.uk
Reply With Quote
  #7 (permalink)  
Old February 9th, 2005, 11:26 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Crmpicco !!!
Here is your answer
Hope this help you :)

<% ' Last Edit: CRM_09feb05 %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
function Trim(obj)
{
return (obj.value).replace(/^\s+/,"").replace(/\s+$/,"") ;
}

function valid(df)
{
// CRM_removed_20jan05
//if (df.pubfares.checked==false)
// {
// df.pubfares.value="no"
// }
// {
// df.pubfares.value="yes"
// }

df = document.form

if ( Trim(df.agency_name).length==0)

    {
    alert("Please enter the Agency Name")
    df.agency_name.focus();
    df.agency_name.select();
    return false;
    }

if (Trim(df.address).length==0)

    {
    alert("Please enter the Address")
    df.address.focus();
    df.address.select();
    return false;
    }

if (Trim(df.town_city).length==0)

    {
    alert("Please enter the Town or City")
    df.town_city.focus();
    df.town_city.select();
    return false;
    }

if (Trim(df.postcode).length==0)

    {
    alert("Please enter Postcode")
    df.postcode.focus();
    df.postcode.select();
    return false;
    }

if (Trim(df.tel_no).length==0)

    {
    alert("Please enter the Telephone Number")
    df.tel_no.focus();
    df.tel_no.select();
    return false;
    }

if (Trim(df.main_contact).length==0)

    {
    alert("Please enter the Main Contact")
    df.main_contact.focus();
    df.main_contact.select();
    return false;
    }

if (Trim(df.email).length==0)

    {
    alert("Please enter the email address")
    df.email.focus();
    df.email.select();
    return false;
    }

if (Trim(df.mas_con_id).length==0)

    {
    alert("Please enter the Master Consultant ID")
    df.mas_con_id.focus();
    df.mas_con_id.select();
    return false;
    }

if (Trim(df.mas_passwd).length==0)

    {
    alert("Please enter the Master Password")
    df.mas_passwd.focus();
    df.mas_passwd.select();
    return false;
    }

var Email=df.email.value;
    if((Email.indexOf("@")==-1)||(Email.indexOf(".")==-1))
        {
        alert("Please enter valid email Address");
        df.email.focus();
        df.email.select();
        return false;
        }

}
</script>
</head>

<body bgcolor="#f5f5f5">
<form name="form" onSubmit="return valid();">
<table width="550" bgcolor="#ECECEC" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
    <td width="16" bgcolor="#ECECEC"><img src="images/top_lefbb.gif" width="16" height="16"></td>
    <td height="16" bgcolor="#ECECEC" background="images/top_midbb.gif"><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="#666666" align="center" cellpadding="0" cellspacing="1">

            <tr bgcolor="#006699" bordercolor="#000000" border="1"><Td colspan="3" align="Left"><span class="style1"><strong>Add Agent</strong></span></td>
         </tr>

            <tr>
             <td height="25" colspan="3" align="center" bordercolor="#ececec" border="0">
             Please Enter the Agent's details below
             </td>
         </tr>
            <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0">&nbsp;</td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;</td>
         </tr>
            <tr>
             <td width="43%" height="25" align="right" bordercolor="#ececec" border="0">
             Agency Name&nbsp;
             </td>
             <td width="5%" align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td width="52%" height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="agency_name" id="agency_name" size="25">
             </td>
         </tr>
            <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Address&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
                <input type="text" name="address" id="address" size="25"></td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             &nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0">&nbsp;</td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
                <input type="text" name="address2" id="address2" size="25"></td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             &nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0">&nbsp;</td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
                <input type="text" name="address3" id="address3" size="25"></td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Town / City&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
                <input type="text" name="town_city" id="town_city"></td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Postcode&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
                <input type="text" name="postcode" id="postcode" size="10"></td>
         </tr>
             <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Telephone Number&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="tel_no" id="tel_no" size="15">
             </td>
         </tr>
            <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Main Contact&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="main_contact" id="main_contact" size="25">
             </td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Email Address&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="email" id="email" size="25">
             </td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Published Fares&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0">&nbsp;</td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
            
             Yes<input type="radio" name="pub_fares" id="pub_fares" value="yes">
             No<input type="radio" name="pub_fares" id="pub_fares" value="no">
            
             </td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Master Consultant ID&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="mas_con_id" id="mas_con_id">
             </td>
         </tr>
         <tr>
             <td height="25" align="right" bordercolor="#ececec" border="0">
             Master Password&nbsp;</td>
             <td align="left" bordercolor="#ececec" border="0"><img src="images/required.gif" align="right"></td>
             <td height="25" align="left" bordercolor="#ececec" border="0">&nbsp;
             <input type="text" name="mas_passwd" id="mas_passwd">
             </td>
         </tr>
        
            <tr>
             <td height="25" colspan="3" align="center" bordercolor="#ececec" border="0">&nbsp;</td>
         </tr>
            <tr>
             <td height="25" colspan="3" align="center" bordercolor="#ececec" border="0">
             <input type="submit" name="submit" id="submit" value="Submit" onMouseOver="style.cursor='hand'">&nbsp;&nbsp;
             <input type="button" name="back" id="back" value="Back" onMouseOver="style.cursor='hand'" onClick="history.back()">
             </td>
            
         </tr>
            <tr><td height="25" colspan="3" align="center" bordercolor="#ececec" border="0">&nbsp;</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>
</form>
</body>
</html>


Cheers :)

vinod
Reply With Quote
  #8 (permalink)  
Old February 15th, 2005, 10:38 AM
Registered User
 
Join Date: Feb 2005
Location: , NJ, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi crmpicco,

If this Trim function still does not work, try using an uppercase T when calling it!
It appears the function is declared Trim and you are calling it:
  if (trim(df.main_contact.value=="")

Cheers!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recordset Empty Check Coby Access VBA 2 April 27th, 2007 04:09 PM
Empty Fields priority05 Access ASP 3 January 10th, 2005 04:40 PM
How to check if you have an empty array Ciarano VB How-To 9 March 31st, 2004 09:17 AM
check if empty hosefo81 Javascript How-To 12 March 9th, 2004 08:43 AM
How to check if collection is empty Ciarano Beginning VB 6 2 March 5th, 2004 08:11 AM



All times are GMT -4. The time now is 05:17 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.