Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 02-09-2009
Member
 
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.
Reply With Quote
  #2  
Old 02-09-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
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.
Reply With Quote
  #3  
Old 02-09-2009
Member
 
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>
Reply With Quote
  #4  
Old 02-09-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
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


Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "HTML if else statement"
Thread Thread Starter Forum Replies Last Post
How to use Else and Else If Statement in PHP? Orton Software Development 5 05-03-2010 06:49 AM
How to use If statement in PHP? Deabelos Software Development 4 09-02-2010 06:14 AM
How to define HTML Validator and services provided by HTML Validator Aldous Software Development 3 22-09-2009 01:12 PM
If Statement in HTML Beatrisa Software Development 3 07-08-2009 02:33 PM
What is the difference between while statement & do statement? Athos Software Development 4 25-02-2009 08:52 PM


All times are GMT +5.5. The time now is 12:25 AM.