Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP 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 16th, 2006, 10:34 AM
Authorized User
 
Join Date: Jan 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Checkbox validate

Dear colleagues,

Am working on a beginners project and I have problems with my checkboxes. These checkboxes are an array and I need to validate them.
- Students are supposed to choose 2 courses per week.
- However Financial Management is taught for a whole week hence if a student chooses this course in week 1, they are NOT allowed to choose another course in that particular week.
- If a student chooses Financial Management in week 1, they MUST choose it again in week 2.

How do I validate these?

_________________________
The code for the table looks like:

____________________
<html>
<head>
</head>

<body>

<form method="POST" action="insert.php">
        <table border="0" width="500" id="table1" cellspacing="0" cellpadding="0">
        <tr>
            <td width="397"><b>Course Name</b></td>
            <td width="103"><strong>
                                                        Select</strong></td>
        </tr>
        <tr>
            <td width="500" bgcolor="#C0C0C0" colspan="2"><b>WEEK1</b></td>
        </tr>
        <tr>
            <td width="397"><span style="font-size: 11px">
                            Financial Management</span></td>
            <td width="103">
            <input type="checkbox" name="chkCourse[]" value="Financial Management"></td>
        </tr>
        <tr>
            <td width="397"><span style="font-size: 11px">
                            Product Marketing
                            </span></td>
            <td width="103">
            <input type="checkbox" name="chkCourse[]" value="Product Marketing"></td>
        </tr>
        <tr>
            <td width="397"><span style="font-size: 11px">
                            &nbsp;Loan
                            Portfolio Audit Toolkit</span></td>
            <td width="103">
            <input type="checkbox" name="chkCourse[]" value=" Loan Portfolio Audit Toolkit"></td>
        </tr>
        <tr>
            <td width="397"><span style="font-size: 11px">
                            &nbsp;Process Mapping </span></td>
            <td width="103">
            <input type="checkbox" name="chkCourse[]" value=" Process Mapping"></td>
        </tr>
        <tr>
            <td colspan="2" bgcolor="#C0C0C0"><b>WEEK 2</b></td>
        </tr>
        <tr>
            <td width="397"><span style="font-size: 11px">
                            Financial Management (continued.) </span></td>
            <td width="103">
            <input type="checkbox" name="chkCourse[]" value="Financial Management"></td>
        </tr>
        <tr>
            <td width="397"><span style="font-size: 11px">
            Strategic Marketing </span></td>
            <td width="103">
            <input type="checkbox" name="chkCourse[]" value="Strategic Marketing"></td>
        </tr>
        <tr>
            <td width="397"><span style="font-size: 11px">
            Risk Management </span></td>
            <td width="103">
            <input type="checkbox" name="chkCourse[]" value="Risk Management"></td>
        </tr>
        <tr>
            <td width="397"><span style="font-size: 11px">
            Pilot Testing </span></td>
            <td width="103">
            <input type="checkbox" name="chkCourse[]" value="Pilot Testing "></td>
        </tr>
    </table>
    <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>
________________________________

Thanks.







Similar Threads
Thread Thread Starter Forum Replies Last Post
i want to validate my checkbox by using regular ex prabhu66 ASP.NET 1.0 and 1.1 Basics 1 May 24th, 2007 06:50 AM
checkbox checked by default by html:checkbox sachin.tathod Struts 3 December 4th, 2006 03:41 PM
Validate Date sparc ASP.NET 1.0 and 1.1 Basics 1 September 20th, 2005 09:55 AM
how can i validate the following using a message noor JSP Basics 0 May 14th, 2005 02:24 AM
Email Validate [email protected] HTML Code Clinic 3 June 9th, 2003 10:49 AM





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