Is the DTI fooling you?

Well the validation on the form isn't working either...or there is none?

Code:
<script language="JavaScript" type="text/JavaScript">

        function validateInput() {

            if (document.Form1.txtQuestion.value == '') {
                alert('Please type in a question.')
                return false;
            }

            if (document.Form1.txtFName.value == '') {
                alert('Please type in your first name.')
                return false;
            }

            if (document.Form1.txtSName.value == '') {
                alert('Please type in your surname.')
                return false;
            }

            if (document.Form1.txtEmail.value == '') {
                alert('Please type in your email address.')
                return false;
            }

            if (document.Form1.txtTelNr.value == '') {
                alert('Please type in your telephone number.')
                return false;
            }

        }

Theres no return value for true :D
 
Code:
<script language="JavaScript" type="text/JavaScript">

        function validateInput() {

            if (document.Form1.txtQuestion.value == '') {
                alert('Please type in a question.')
                return false;
            }

            if (document.Form1.txtFName.value == '') {
                alert('Please type in your first name.')
                return false;
            }

            if (document.Form1.txtSName.value == '') {
                alert('Please type in your surname.')
                return false;
            }

            if (document.Form1.txtEmail.value == '') {
                alert('Please type in your email address.')
                return false;
            }

            if (document.Form1.txtTelNr.value == '') {
                alert('Please type in your telephone number.')
                return false;
            }

        }

Theres no return value for true :D

Is this not the part of the code not only the part of the site that checks if you left a field blank?
 
Is this not the part of the code not only the part of the site that checks if you left a field blank?

If the field is blank, its meant to submit false (dont allow form to be submitted), if the field is filled in, its meant to return true (allow form to be submitted). So theres no way for someone to submit it, as there is no true. Thats how I understand it.
 
This would be a better working example:

Code:
  <script language="JavaScript" type="text/JavaScript"> 
 
        function validateInput() {
 
            if (document.Form1.txtQuestion.value == '') {
                alert('Please type in a question.')
                return false;
            }
			else if (document.Form1.txtFName.value == '') {
                alert('Please type in your first name.')
                return false;
            }
			else if (document.Form1.txtSName.value == '') {
                alert('Please type in your surname.')
                return false;
            }
            else if (document.Form1.txtEmail.value == '') {
                alert('Please type in your email address.')
                return false;
            }
            else if (document.Form1.txtTelNr.value == '') {
                alert('Please type in your telephone number.')
                return false;
            }
			else
			{
				return true;	
			}
 
        }
    </script>
 
This would be a better working example:

Code:
  <script language="JavaScript" type="text/JavaScript"> 
 
        function validateInput() {
 
            if (document.Form1.txtQuestion.value == '') {
                alert('Please type in a question.')
                return false;
            }
			else if (document.Form1.txtFName.value == '') {
                alert('Please type in your first name.')
                return false;
            }
			else if (document.Form1.txtSName.value == '') {
                alert('Please type in your surname.')
                return false;
            }
            else if (document.Form1.txtEmail.value == '') {
                alert('Please type in your email address.')
                return false;
            }
            else if (document.Form1.txtTelNr.value == '') {
                alert('Please type in your telephone number.')
                return false;
            }
			else
			{
				return true;	
			}
 
        }
    </script>

There is no need to return true.....
 
It has been my experience that ALL government websites suffer with errors in some form or another.

The DTI and the "BROAD-BASED BLACK ECONOMIC EMPOWERMENT ACT 53 OF 2003" topic that it refers to in my view has reached and is beyond the "SELL BY DATE" 17 years after the big change in 1994, accordindly I consider this as government interferrence with the spirt and principal of "Free Enterprise" in business. Trying to control the "Procurement" process failed before getting off the ground. Social engineering in business has never worked,the good old market force does the job.
 
There is no need to return true.....

Correct if it returns false the postback is cancelled...

However this is not how you validate a phone number :confused:

if (document.Form1.txtTelNr.value == '') {
alert('Please type in your telephone number.')
return false;
}
 
How's the name of the one image on the site:
"faq_off.jpg"

Ha ha ha ha :D
 
I hope they didn't pay actual money for that site...looks like a school project.
 
Top
Sign up to the MyBroadband newsletter
X