code glitch

Posted on 2007-10-17
Last Modified: 2010-04-16
I can't figure out why this code is making the page always say You MUST accept the Terms and Conditions. it's near the bottom but I can't figure out what's wrong. Any suggestions?

<SCRIPT Language="JavaScript">
      function  Verify()
            if (Data_Form.New_UserName.value == '')
                  alert('User Name is a required field.');
            else if (Data_Form.New_First_Name.value == '')
                  alert('First Name is a required field.');
            else if (Data_Form.New_Last_Name.value == '')
                  alert('Last Name is a required field.');
            if (Data_Form.New_Title.value == '')
                  alert('Title is a required field.');
            else if (Data_Form.New_LAN_AreaCode.value == '' || Data_Form.New_LAN_Phone1.value == '' || Data_Form.New_LAN_Phone2.value == '')
                  alert('LAN Phone is a required to be completely filled.');
            else if (Data_Form.New_SS_No1.value == '' || Data_Form.New_SS_No2.value == '' || Data_Form.New_SS_No3.value == '')
                  alert('Social Security # / FEderal Tax ID is required.');
            else if (Data_Form.New_DOB.value == '')
                  alert('Date of Birth is required.');
            else if (Data_Form.New_Password.value == '')
                  alert('Password is required.');
            else if (Data_Form.New_Password.value != Data_Form.Verify_Password.value)
                  alert('Your Passwords Dont Verify.');
                  Data_Form.New_Password.value = '';
                  Data_Form.Verify_Password.value = '';
            else if (Data_Form.New_Accept.value = '0')
                  alert('You MUST accept the Terms and Conditions.');
                  if (confirm('By clicking [OK] you are accepting and agreeing to all the terms and conditions of the Tremcor Agreement.'));
      function on_Accept_Click()
            if (Data_Form.Checkbox_Accept.checked)
                  Data_Form.New_Accept.value = '1';
                  Data_Form.New_Accept.value = '0';
Question by:StrategicGnomer
    LVL 23

    Accepted Solution

    use == not = for boolean test

    else if (Data_Form.New_Accept.value == '0')

    Author Comment

    ooohhhh, i knew it was something ridiculously simple.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    This article will show, step by step, how to integrate R code into a R Sweave document
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now