Results 1 to 4 of 4

Thread: HTML if else statement

  1. #1
    Join Date
    Jul 2009
    Posts
    30

    HTML if else statement

    Hi friends,

    I am creating a html pages where i have created 3 tables which is as follows Student (student_Num,first_Name,last_Name,Course_Name), course (course_ID,course_Total_Capacity), course_allocation (student_Num,course_ID). For teh time being i am having three courses, English=100, Hindi=101, Marathi=102. In this form i would like to have if else statement or any if statement where, if any user selects CourseName as English then Course_ID 100, should be entered to the course and course_allocation tables and English entered to the Course_Name table. course_allocation tables and English entered to the Course_Name table.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    HTML if else statement

    Sure i will help you out with if else statement before that can you provide me some more information about your form. It would be very helpful if you can provide me coding of your form where you are using this tables in HTML and as per my knowledge HTML doesn't support if else statement for that you can use PHP.

  3. #3
    Join Date
    Jul 2009
    Posts
    30

    HTML if else statement

    I am using following code for my form, i want mine if you use any other programming languages apart from HTML.

    HTML Code:
    <SELECT NAME="Course_Name">
    <OPTION VALUE="English">English</OPTION>
    <OPTION VALUE="Hindi">Hindi</OPTION>
    <OPTION VALUE="Marathi">Marathi</OPTION>
    </SELECT></td></tr>
    
    <SELECT NAME="Course_ID">
    <OPTION VALUE="100">English=100</OPTION>
    <OPTION VALUE="101">Hindi=101</OPTION>
    <OPTION VALUE="102">Marathi=102</OPTION>
    </SELECT>

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    HTML if else statement

    Don't worry brother i have created a code for you in PHP which you need to use along with your HTML coding and there is no need to two select option.Following are the code for the same.


    HTML Code:
    <SELECT NAME="course_ID">
    <OPTION VALUE="100">English</OPTION>
    <OPTION VALUE="101">Hindi</OPTION>
    <OPTION VALUE="102">Marathi</OPTION>
    </SELECT>
    PHP Code:
    if ($course_ID =='100')
    {
          
    $Course_Name 'English';

          
    //code for the insert statement
    }

    if (
    $course_ID =='101')
    {
          
    $Course_Name 'Hindi';

          
    //code for the insert statement



    if (
    $course_ID =='102')
    {
          
    $Course_Name 'Marathi';

          
    //code for the insert statement



Similar Threads

  1. How to use Else and Else If Statement in PHP?
    By Orton in forum Software Development
    Replies: 5
    Last Post: 05-03-2010, 06:49 AM
  2. How to use If statement in PHP?
    By Deabelos in forum Software Development
    Replies: 4
    Last Post: 09-02-2010, 06:14 AM
  3. Replies: 3
    Last Post: 22-09-2009, 01:12 PM
  4. If Statement in HTML
    By Beatrisa in forum Software Development
    Replies: 3
    Last Post: 07-08-2009, 02:33 PM
  5. Replies: 4
    Last Post: 25-02-2009, 08:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,585,254.32484 seconds with 16 queries