473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Bit of help please, re form validation.

Hi I'm a VB bloke really, but need to use javascript from time to time.
I have a form an validate it as follows:
~~~~~~~~~~
function Validate()
{
if (QuotePart2.SubsidenceCover.Value=="Yes" &&
QuotePart2.Buildings.Value=="")
{
alert('You have selected buildings cover, but not entered the
value of the buildings, please do so.');
return false;
}

else if (document.QuotePart2.Agreed.checked == false)
{
alert('You must tick the box to show that you have checked the
sums insured, and they are correct.');
return false;
}
return true;
}
~~~~~~~~~~
My problem is that ensuring the checkbox is checked works just fine,
but I can't get the first bit to work, SubsidenceCover is a drop down,
if "Yes" is selected but there is no value in Buidings I need to stop
there, can anyone spot an error?

Many thanks

Jon

Jul 14 '06 #1
2 1157
J-P-W wrote:
Hi I'm a VB bloke really, but need to use javascript from time to time.
I have a form an validate it as follows:
~~~~~~~~~~
function Validate()
{
if (QuotePart2.SubsidenceCover.Value=="Yes" &&
QuotePart2.Buildings.Value=="")
Should be value, not Value.

--
Ian Collins.
Jul 15 '06 #2

Ian Collins wrote:
J-P-W wrote:
Hi I'm a VB bloke really, but need to use javascript from time to time.
I have a form an validate it as follows:
~~~~~~~~~~
function Validate()
{
if (QuotePart2.SubsidenceCover.Value=="Yes" &&
QuotePart2.Buildings.Value=="")

Should be value, not Value.

--
Ian Collins.

I've now learnt that javascript is case sensitive!!! Thank you very
much, my validation now works, kindest regards, Jon

Jul 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
2
by: qsweetbee | last post by:
I have a form(fAddUsers) in my database. It is continue form for data entry. Some fields are required fields. Some are optional fields. There is 1 particular filed(TokenExpirationDate)on the form...
2
by: Paul | last post by:
Hi, I hope somebody can help me with the following. (I have tried searching for a solution on the newsgroups but nothing is quite what I need. Feel free to point me in the direction of anything...
0
by: karen987 | last post by:
This is an email form on an ASP page. I want to add validation before it submits, The current validation only checks "name, email, and content" (server side) if the spaces are empty. I need to add...
1
by: lilbit02 | last post by:
Hi, I have a form that utilizes validation as most do via javascript. This form worked totaly fine until I needed to add a dynamic div now the validation doesn't work. It does work for the first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.