Making Life Easier Indoors

Some of My Favorite Major Appliances for Inside the Home

Element Part

GE DOUBLE OVEN BAKE ELEMENT PART  WB44K5013 NEW IN BOX
GE DOUBLE Oven Bake ELEMENT PART WB44K5013 NEW IN BOX
$20.00
Time Remaining: 29d 13h 38m
Buy It Now for only: $20.00

MAYTAG DRYER HEATING ELEMENT PART 3 11946 NEW
MAYTAG DRYER HEATING ELEMENT PART 3 11946 NEW
$21.99
Time Remaining: 1d 10h 7m

WHIRLPOOL 279838 DRYER ELEMENT  NEW OEM PART
WHIRLPOOL 279838 DRYER ELEMENT NEW OEM PART
$22.50
Time Remaining: 28d 7h 59m
Buy It Now for only: $22.50

77001102 BROIL BROILER ELEMENT AMANA USED PART pb
77001102 BROIL BROILER ELEMENT AMANA USED PART pb
$16.00
Time Remaining: 29d 15h 6m
Buy It Now for only: $16.00

WB44T10011 OVEN BAKE ELEMENT GE KENMORE NEW PART pe
WB44T10011 OVEN Bake Element GE KENMORE NEW PART pe
$23.00
Time Remaining: 4d 8h 21m
Buy It Now for only: $23.00

5303009293 BROIL BROILER ELEMENT FRIGIDAIRE USED PART pb
5303009293 BROIL BROILER ELEMENT FRIGIDAIRE USED PART pb
$45.00
Time Remaining: 28d 11h 3m
Buy It Now for only: $45.00

GE Hotpoint Element Part  WB44K10005 NEW IN BOX
GE Hotpoint Element Part WB44K10005 NEW IN BOX
$27.00
Time Remaining: 29d 17h 10m
Buy It Now for only: $27.00

WB30X342 RANGE 6 SURFACE ELEMENT GE HOTPOINT NEW PART pe
WB30X342 RANGE 6 SURFACE ELEMENT GE HOTPOINT NEW PART pe
$24.00
Time Remaining: 28d 7h 13m
Buy It Now for only: $24.00

GE Stove Top Heating Element Parts KiT 55 8
GE Stove Top Heating Element Parts KiT 55 8
$19.95
Time Remaining: 14h 29m

GE DOUBLE OVEN BAKE ELEMENT PART  WB44K5013
GE DOUBLE OVEN BAKE ELEMENT PART WB44K5013
$15.00
Time Remaining: 21d 9h 13m
Buy It Now for only: $15.00

 Frigidaire Range Dual Surface Element 316224300 316418400
Frigidaire Range Dual Surface Element 316224300 316418400
$75.00
Time Remaining: 28d 12h 48m
Buy It Now for only: $75.00

WHIRLPOOL DISHWASHER W10134009 8572861 HEATER ELEMENT USED PART ASSEMBLY
Whirlpool Dishwasher W10134009 8572861 HEATER ELEMENT USED PART ASSEMBLY
$14.88
Time Remaining: 22d 12h 42m
Buy It Now for only: $14.88

GE RANGE BAKE ELEMENT PART  WB44K10005
GE RANGE BAKE ELEMENT PART WB44K10005
$9.45
Time Remaining: 5h 40m
Buy It Now for only: $9.45

Kenmore 70 80 90 Series Dryer parts Heating Element 8565582
Kenmore 70 80 90 Series Dryer parts Heating Element 8565582
$41.25
Time Remaining: 26d 7h 4m
Buy It Now for only: $41.25

3387747 DRYER HEATING ELEMENT KENMORE WHIRLPOOL NEW PART pe
3387747 DRYER HEATING ELEMENT KENMORE WHIRLPOOL NEW PART pe
$29.00
Time Remaining: 23d 9h 11m
Buy It Now for only: $29.00

GE Stove Top Heating Element Parts KiT 85 8
GE Stove Top Heating Element Parts KiT 85 8
$24.95
Time Remaining: 14h 31m

Y308612 DRYER HEAT HEATER HEATING ELEMENT MAYTAG USED PART ug
Y308612 DRYER HEAT HEATER HEATING ELEMENT MAYTAG USED PART ug
$10.00
Time Remaining: 23d 5h 15m
Buy It Now for only: $10.00

MAYTAG RANGE BURNER ELEMENT 1500W PART 31794601 8523697
Maytag Range BURNER ELEMENT 1500W PART 31794601 8523697
$2.95
Time Remaining: 2d 13h 7m
Buy It Now for only: $2.95

Frigidaire Genuine Renewal Parts Oven Element 316075100 NIB
Frigidaire Genuine Renewal Parts Oven Element 316075100 NIB
$44.99
Time Remaining: 29d 14h 2m
Buy It Now for only: $44.99

WB44X10015 BROIL BROILER ELEMENT GE USED PART pb
WB44X10015 BROIL BROILER ELEMENT GE USED PART pb
$25.00
Time Remaining: 7d 9h 3m
Buy It Now for only: $25.00

WHIRLPOOL SIDEKICK DEFROST ELEMENT PART  8201747
WHIRLPOOL SIDEKICK DEFROST ELEMENT PART 8201747
$69.85
Time Remaining: 10h 48m
Buy It Now for only: $69.85

3051071 BROIL BROILER ELEMENT FRIGIDAIRE USED PART pb
3051071 BROIL BROILER ELEMENT FRIGIDAIRE USED PART pb
$26.00
Time Remaining: 27d 5h 18m
Buy It Now for only: $26.00

2 WHIRLPOOL Dryer Heat ELEMENTS for PARTS 279838 3398064 8565582 NEW
2 WHIRLPOOL Dryer Heat ELEMENTS for PARTS 279838 3398064 8565582 NEW
$6.99 (1 Bid)
Time Remaining: 2d 7h 37m

GE STOVE BURNER ELEMENT 8 PART  WB30X219
GE STOVE BURNER ELEMENT 8 PART WB30X219
$10.00
Time Remaining: 13d 5h 11m
Buy It Now for only: $10.00

GE RANGE BAKE ELEMENT PART  WB44K5018
GE RANGE BAKE ELEMENT PART WB44K5018
$26.95
Time Remaining: 24d 6h 6m
Buy It Now for only: $26.95

GE RANGE 4 6 8 ELEMENT PART  WB30X0346 WB30X346
GE RANGE 4 6 8 ELEMENT PART WB30X0346 WB30X346
$55.95
Time Remaining: 25d 9h 33m
Buy It Now for only: $55.95

GE DRYER HEATING ELEMENT PART  WE11X83 WE11X0084
GE DRYER HEATING ELEMENT PART WE11X83 WE11X0084
$42.00
Time Remaining: 7d 8h 32m
Buy It Now for only: $42.00

WB30T10078 RANGE 6 SURFACE ELEMENT GE NEW PART pe
WB30T10078 RANGE 6 SURFACE ELEMENT GE NEW PART pe
$20.00
Time Remaining: 23d 10h 59m
Buy It Now for only: $20.00

MAYTAG RANGE BAKE ELEMENT PART  71001680
MAYTAG RANGE BAKE ELEMENT PART 71001680
$4.95
Time Remaining: 21d 5h 12m
Buy It Now for only: $4.95

BROWN STOVE RANGE BROIL ELEMENT 184 2E34 ERB681 APPLIANCE PARTS
BROWN STOVE RANGE Broil Element 184 2E34 ERB681 APPLIANCE PARTS
$7.99
Time Remaining: 3d 10h 26m
Buy It Now for only: $9.99

WHIRLPOOL RANGE BAKE ELEMENT PART  9760766 4448696
WHIRLPOOL RANGE BAKE ELEMENT PART 9760766 4448696
$4.95
Time Remaining: 22d 7h 17m
Buy It Now for only: $4.95

WHIRLPOOL RANGE 8 ELEMENT PART  660533
WHIRLPOOL RANGE 8 ELEMENT PART 660533
$18.95
Time Remaining: 6d 6h 15m
Buy It Now for only: $18.95

VINTAGE STOVE PARTS Thermador Range Chromalox 8 BURNER ELEMENT TK8RH Monotube
VINTAGE STOVE PARTS Thermador Range Chromalox 8 BURNER ELEMENT TK8RH Monotube
$139.95
Time Remaining: 26d 17h 8m
Buy It Now for only: $139.95

TJ90SP21YA SURFACE ELEMENT PRO NEW OEM PART NTO pz
TJ90SP21YA SURFACE ELEMENT PRO NEW OEM PART NTO pz
$12.00
Time Remaining: 1d 7h 21m
Buy It Now for only: $12.00

MAYTAG RANGE BROIL ELEMENT PART  0063532 Y0063532
MAYTAG RANGE BROIL ELEMENT PART 0063532 Y0063532
$16.95
Time Remaining: 17d 7h 24m
Buy It Now for only: $16.95

8544771 DRYER HEATING ELEMENT WHIRLPOOL KENMORE NEW PART NTO pz
8544771 DRYER HEATING ELEMENT WHIRLPOOL KENMORE NEW PART NTO pz
$57.00
Time Remaining: 28d 9h 40m
Buy It Now for only: $57.00

Heat element for washer dryer combo MJ9900 part  17 1168
Heat Element for washer Dryer Combo MJ9900 part 17 1168
$34.99
Time Remaining: 3d 1h 27m
Buy It Now for only: $49.99

GE STOVE SURFACE ELEMENT PART  WB30M1
GE STOVE SURFACE ELEMENT PART WB30M1
$8.95
Time Remaining: 14d 7h
Buy It Now for only: $8.95

GE STOVE BAKE ELEMENT PART  WB44X5082
GE STOVE BAKE ELEMENT PART WB44X5082
$18.00
Time Remaining: 18d 13h 35m
Buy It Now for only: $18.00

WHIRLPOOL DEFROST ELEMENT PART  2315530
WHIRLPOOL DEFROST ELEMENT PART 2315530
$25.95
Time Remaining: 10h 45m
Buy It Now for only: $25.95

WHITE WESTINGHOUSE RANGE BAKE ELEMENT PART  5303051519
WHITE WESTINGHOUSE RANGE BAKE ELEMENT PART 5303051519
$3.49
Time Remaining: 21d 11h 28m
Buy It Now for only: $3.49

WB44X5019 OVEN BAKE ELEMENT GE HOTPOINT RCA NEW PART pe
WB44X5019 OVEN BAKE ELEMENT GE HOTPOINT RCA NEW PART pe
$34.00
Time Remaining: 7d 9h 11m
Buy It Now for only: $34.00

WHIRLPOOL DRYER ELEMENT PART  4391960
WHIRLPOOL DRYER ELEMENT PART 4391960
$14.95
Time Remaining: 28d 13h 42m
Buy It Now for only: $14.95

SEARS KENMORE VESTA ATHENS RANGE BROIL ELEMENT RP729 CH1030 APPLIANCE PARTS
SEARS KENMORE VESTA ATHENS RANGE BROIL ELEMENT RP729 CH1030 APPLIANCE PARTS
$4.99
Time Remaining: 4d 9h 59m
Buy It Now for only: $9.99

FRIGIDAIRE ELECTRIC STOVE 316075102 316075104 LOWER BAKE ELEMENT USED PART
FRIGIDAIRE ELECTRIC STOVE 316075102 316075104 LOWER BAKE ELEMENT USED PART
$18.88
Time Remaining: 6d 10h 30m
Buy It Now for only: $18.88

WHIRLPOOL RANGE 6 BURNER ELEMENT PART  660532 660528
WHIRLPOOL RANGE 6 BURNER ELEMENT PART 660532 660528
$9.95
Time Remaining: 7d 5h 23m
Buy It Now for only: $9.95

MAYTAG RANGE ELEMENT 2000W PART  32083001 Y0316127
MAYTAG RANGE ELEMENT 2000W PART 32083001 Y0316127
$9.95
Time Remaining: 11d 7h 52m
Buy It Now for only: $9.95

WHIRLPOOL DRYER ELEMENT PART  56047 61927
WHIRLPOOL DRYER ELEMENT PART 56047 61927
$16.95
Time Remaining: 22d 2h 27m
Buy It Now for only: $16.95

FSP OEM Electric Dryer Heating Element Part Number 4391960
FSP OEM Electric Dryer Heating Element Part Number 4391960
$22.00
Time Remaining: 10d 13h 22m
Buy It Now for only: $22.00

KENMORE RANGE ELEMENT PART  WB44T10014
KENMORE RANGE ELEMENT PART WB44T10014
$21.95
Time Remaining: 24d 10h 37m
Buy It Now for only: $21.95

 Whirlpool Range Surface Element 8272563 4453909
Whirlpool Range Surface Element 8272563 4453909
$55.00
Time Remaining: 24d 5h 48m
Buy It Now for only: $55.00

Surface Element Switch for Bosch Range Part 705047
Surface Element Switch for Bosch Range Part 705047
$20.99
Time Remaining: 1d 13h 5m
Buy It Now for only: $23.99

9758519 OVEN BAKE ELEMENT KENMORE USED PART pg
9758519 OVEN BAKE ELEMENT KENMORE USED PART pg
$5.00
Time Remaining: 2d 7h 48m
Buy It Now for only: $5.00

WB24T10145 RANGE SURFACE ELEMENT CONTROL SWITCH GE NEW OEM PART NTO fz
WB24T10145 RANGE SURFACE ELEMENT CONTROL SWITCH GE NEW OEM PART NTO fz
$12.00
Time Remaining: 1d 10h 6m
Buy It Now for only: $12.00

MAYTAG RANGE 8 BURNER ELEMENT PART Y04000033 D8549502
MAYTAG RANGE 8 BURNER ELEMENT PART Y04000033 D8549502
$2.95
Time Remaining: 1d 11h 44m
Buy It Now for only: $2.95

WHIRLPOOL STOVE SURFACE ELEMENT PART  8273994
WHIRLPOOL STOVE SURFACE ELEMENT PART 8273994
$9.95
Time Remaining: 16d 10h 10m
Buy It Now for only: $9.95

KENMORE RANGE SURFACE ELEMENT 1500W PART  WB30T10047
KENMORE RANGE SURFACE ELEMENT 1500W PART WB30T10047
$4.95
Time Remaining: 26d 8h 20m
Buy It Now for only: $4.95

Part 04000057 part Y04000057 Replacement broil element for ranges
Part 04000057 part Y04000057 Replacement broil element for ranges
$20.00
Time Remaining: 28d 5h 5m
Buy It Now for only: $20.00

Whirlpool Kenmore Dryer Element Part 696324 5200 W
Whirlpool Kenmore Dryer Element Part 696324 5200 W
$5.99
Time Remaining: 5d 12h 21m
Buy It Now for only: $10.50

New Magic Chef dryer part 63 5255 Dryer element
New Magic Chef dryer part 63 5255 Dryer element
$71.00
Time Remaining: 29d 14h 29m
Buy It Now for only: $71.00

MAYTAG RANGE 6 ELEMENT PART  12001231
MAYTAG RANGE 6 ELEMENT PART 12001231
$1.95
Time Remaining: 17d 9h 9m
Buy It Now for only: $1.95

MAYTAG DRYER HEATER RE SRTRING ELEMENT PART  314503
MAYTAG DRYER HEATER RE SRTRING ELEMENT PART 314503
$19.95
Time Remaining: 16d 12h 53m
Buy It Now for only: $19.95

Part 1409868 Replacement heating element for Thermador ranges
Part 1409868 Replacement heating element for Thermador ranges
$30.00
Time Remaining: 28d 5h 14m
Buy It Now for only: $30.00

WHIRLPOOL DRYER ELEMENT PART  4391960 693062
WHIRLPOOL DRYER ELEMENT PART 4391960 693062
$3.95
Time Remaining: 9d 8h 25m
Buy It Now for only: $3.95

WHIRLPOOL RANGE BURNER ELEMENT 12 PART  W10169796
WHIRLPOOL RANGE BURNER ELEMENT 12 PART W10169796
$21.95
Time Remaining: 19d 12h
Buy It Now for only: $21.95

General Electric Dryer heating element assembly part  WE11M30
General Electric Dryer heating element assembly part WE11M30
$65.00
Time Remaining: 1d 12h 24m

MAYTAG RANGE 6 ELEMENT 1200W PART  12500039 74005476
MAYTAG RANGE 6 ELEMENT 1200W PART 12500039 74005476
$5.95
Time Remaining: 29d 7h 38m
Buy It Now for only: $5.95

9760766 OVEN BAKE ELEMENT WHIRLPOOL USED PART pa
9760766 OVEN BAKE ELEMENT WHIRLPOOL USED PART pa
$21.00
Time Remaining: 14d 7h 47m
Buy It Now for only: $21.00

Part 0091222 Replacement heating element for ranges
Part 0091222 Replacement heating element for ranges
$30.00
Time Remaining: 28d 4h 56m
Buy It Now for only: $30.00

AMANA DRYER HEATER ELEMENT PART  Y503978 NEW
AMANA DRYER HEATER ELEMENT PART Y503978 NEW
$24.00
Time Remaining: 27d 3h 27m
Buy It Now for only: $24.00

KENMORE ELECTRIC OVEN WB44K10002 BROIL ELEMENT USED PART ASSEMBLY FREE SHIPPING
KENMORE ELECTRIC OVEN WB44K10002 BROIL ELEMENT USED PART ASSEMBLY FREE SHIPPING
$14.88
Time Remaining: 15d 12h 39m
Buy It Now for only: $14.88

KENMORE ELECTRIC OVEN 8523698 8053621 SURFACE ELEMENT 1200 WATTS USED PART
KENMORE ELECTRIC OVEN 8523698 8053621 SURFACE ELEMENT 1200 WATTS USED PART
$34.88
Time Remaining: 19d 11h 57m
Buy It Now for only: $34.88

Electrolux Element Broil Part  5303051516 for oven
Electrolux Element Broil Part 5303051516 for oven
$19.99
Time Remaining: 6d 17h 18m
Buy It Now for only: $29.99

KENMORE DRYER ELEMENT PART  691724 4391960
KENMORE DRYER ELEMENT PART 691724 4391960
$3.25
Time Remaining: 3d 16h 21m
Buy It Now for only: $3.25

AMANA DRYER HEATER ELEMENT PART  Y503978
AMANA DRYER HEATER ELEMENT PART Y503978
$18.95
Time Remaining: 14d 6h 24m
Buy It Now for only: $18.95

318178110 RANGE SURFACE ELEMENT KENMORE FRIGIDAIRE TAPPAN NEW PART pz
318178110 RANGE SURFACE ELEMENT KENMORE FRIGIDAIRE TAPPAN NEW PART pz
$39.00
Time Remaining: 7h 7m
Buy It Now for only: $39.00

NEW FRIGIDAIRE RANGE ELEMENT 3000W PART  316282000
NEW FRIGIDAIRE RANGE ELEMENT 3000W PART 316282000
$32.95
Time Remaining: 28d 8h 48m
Buy It Now for only: $32.95

WHIRLPOOL RANGE BAKE ELEMENT PART  Y04000066
WHIRLPOOL RANGE BAKE ELEMENT PART Y04000066
$8.95
Time Remaining: 8d 7h 4m
Buy It Now for only: $8.95

PART  WB44X5082 OEM GE OVEN BAKE ELEMENT NEW
PART WB44X5082 OEM GE OVEN BAKE ELEMENT NEW
$26.44
Time Remaining: 15d 18h 4m
Buy It Now for only: $26.44

Kenmore Whirlpool 66595781000 glass top range parts burner surface element
Kenmore Whirlpool 66595781000 glass top range parts burner surface element
$34.00
Time Remaining: 5d 4h 45m
Buy It Now for only: $39.00

GE RANGE BAKE ELEMENT PART  WB44T10018
GE RANGE BAKE ELEMENT PART WB44T10018
$21.95
Time Remaining: 19d 17h 20m
Buy It Now for only: $21.95

KENMORE DRYER HEATER ELEMENT PART  348774 4391960
KENMORE DRYER HEATER ELEMENT PART 348774 4391960
$3.95
Time Remaining: 19d 8h 48m
Buy It Now for only: $3.95

MAYTAG DRYER HEATER RE SRTRING ELEMENT PART  313538
MAYTAG DRYER HEATER RE SRTRING ELEMENT PART 313538
$19.95
Time Remaining: 16d 12h 56m
Buy It Now for only: $19.95

GE RANGE BAKE ELEMENT PART  WB44K5012
GE RANGE BAKE ELEMENT PART WB44K5012
$18.00
Time Remaining: 11d 14h 36m
Buy It Now for only: $18.00

279838 DRYER HEATING ELEMENT WHIRLPOOL KENMORE MAYTAG NEW OEM PART 11
279838 DRYER HEATING ELEMENT WHIRLPOOL KENMORE MAYTAG NEW OEM PART 11
$45.00
Time Remaining: 15d 7h 11m
Buy It Now for only: $45.00

316555800 RANGE SURFACE ELEMENT KENMORE FRIGIDAIRE NEW NTO PART pz
316555800 RANGE SURFACE ELEMENT KENMORE FRIGIDAIRE NEW NTO PART pz
$47.00
Time Remaining: 19d 7h 55m
Buy It Now for only: $47.00

Washing machine part Heating Element
Washing machine part Heating Element
$23.70
Time Remaining: 5d 9h 25m

GE RANGE SURFACE ELEMENT 8 PART  WB30M2
GE RANGE SURFACE ELEMENT 8 PART WB30M2
$1.25
Time Remaining: 12d 13h 11m
Buy It Now for only: $1.25

Heater Element Appliance Part 395583
Heater Element Appliance Part 395583
$99.99
Time Remaining: 29d 17h 11m
Buy It Now for only: $99.99

NEW Maytag Dual Radiant Surface Element Model 74008228 Genuine OEM Parts
NEW Maytag Dual Radiant Surface Element Model 74008228 Genuine OEM Parts
$33.00
Time Remaining: 1d 10h 7m
Buy It Now for only: $33.00

WHIRLPOOL RANGE BURNER ELEMENT PART  309185 660533
WHIRLPOOL RANGE BURNER ELEMENT PART 309185 660533
$2.95
Time Remaining: 24d 6h 49m
Buy It Now for only: $2.95

New FSP range part 74011575 Element
New FSP range part 74011575 Element
$99.00
Time Remaining: 10d 11h 54m
Buy It Now for only: $99.00

KITCHEN AID DISHWASHER 9743495 HEATER ELEMENT USED PART ASSEMBLY
KITCHEN AID DISHWASHER 9743495 HEATER ELEMENT USED PART ASSEMBLY
$16.88
Time Remaining: 26d 12h 17m
Buy It Now for only: $16.88

Kenmore Dishwasher Heater Element Heater element PART NUMBER W10134009
Kenmore Dishwasher Heater Element Heater element PART NUMBER W10134009
$12.00
Time Remaining: 6d 3h

FRIGIDAIRE DISHWASHER HEATING ELEMENT PART  154665201
FRIGIDAIRE DISHWASHER HEATING ELEMENT PART 154665201
$6.95
Time Remaining: 2d 5h 15m
Buy It Now for only: $6.95

KENMORE RANGE 8 ELEMENT PART  WB30X253
KENMORE RANGE 8 ELEMENT PART WB30X253
$7.50
Time Remaining: 5d 10h 18m
Buy It Now for only: $7.50

PART  WB44X5043 OEM GE OVEN BAKE ELEMENT NEW
PART WB44X5043 OEM GE OVEN BAKE ELEMENT NEW
$22.09
Time Remaining: 7d 8h 34m
Buy It Now for only: $22.09

WB30X219 RANGE 8 SURFACE ELEMENT GE NEW PART pe
WB30X219 RANGE 8 SURFACE ELEMENT GE NEW PART pe
$19.00
Time Remaining: 26d 5h 7m
Buy It Now for only: $19.00

MAYTAG RANGE SURFACE ELEMENT 6 PART  74007158 9761348
MAYTAG RANGE SURFACE ELEMENT 6 PART 74007158 9761348
$1.95
Time Remaining: 7d 11h 52m
Buy It Now for only: $1.95

WHIRLPOOL RANGE BAKE ELEMENT PART  9758541
WHIRLPOOL RANGE BAKE ELEMENT PART 9758541
$15.95
Time Remaining: 18d 5h 12m
Buy It Now for only: $15.95

Element Part
Element Part

Validating select element in jQuery

<!--StartFragment-->

Checking that at least an option is selected in the select element

<!--EndFragment-->

In this article, we will learn to validate select element (drop down list). That is, we will assure that user selects an option in the select element. If user doesn't selects any option from the select element, an error message is displayed

We will display some food items through a drop down list (select element). We will confirm that the user selects an option from the drop down list when selecting the submit button or else an error message is displayed.

HTML file for "Validating select element in jQuery"

Following is a HTML file that displays a drop down list box containing few food items. The select element with the help of which the drop down list is displayed is assigned the class name ‘infobox' so as to apply the style properties defined in the class selector ‘.infobox' (written in the style sheet file: style.css) can be directly applied to it. The label message: ‘Select the Food Item' is displayed via span element with class name assigned : ‘label'. The error message is displayed via paragraph element with class name assigned as ‘error' and the submit button is assigned a class name: ‘submit'. The HTML code may appear as shown below:

 

 

<form>

 

Select the Food Item

Select a FoodPizza $5HotDog $2Coke $1French Fries $3

 

You have not selected any Option

 

 

 

 

<input class="submit" type="submit" value="Submit" /></p>

 

</form>

 

 

The external style sheet may contain following class selectors that will be automatically applied to the respective HTML element of the specified class:

style.css

.label {float: left; width: 150px; }

.infobox {width: 150px; }

.error { color: red; padding-left: 10px; }

.submit { margin-left: 150px; margin-top: 10px;}

 

In the style sheet file, the class selector: ‘.label' contains the float property set to value: ‘left' so as to make the label appears on its left (creating space for the drop down list to appear on its right) and the width property set to value 150px to define the width that the label can consume. The class selector: ‘.infobox'  contains the width property set to value 150px to specify the width for the drop down list  and the class selector ‘.error' is for assigning red color to the error messages  and for making the error message appear at the distance of 10px from the left side of the browser window. The class selector ‘submit' contains margin-left property set to value 150px to make the Submit button appear at the distance of 150px from the left side of the browser window (so that it appears below the drop down list) and margin-top property set to value 10px to keep some spacing from the above element that may appear (error or result message).

Code for "Validating select element in jQuery"

The jQuery code to confirm that the option from the drop down list is selected is as shown below:

$(document).ready(function() {

$('.error').hide();

$('.submit').click(function(event){

var count=$('select option:selected').val();

if(count==0)

{

$('p.result').hide();

$('.error').show();

}

else

{

$('.error').hide();

$('p.result').show();

$('p.result').text('You have selected '+$('select option:selected').text());

}

event.preventDefault();

});

});

 

In the jQuery code, we initially hide the paragraph element of class ‘error' meant to display error message. Then, we attach a click event to the submit button. The statement:

var count=$('select option:selected').val();

retrieves the value of the option selected from the select element and stores it in variable: count. If the value of count is 0, meaning user has not selected any option, we make the error message appear on the screen by making the paragraph element of class '.error' visible and if the value of count variable is non zero, we make the paragraph element of class 'result' to display the result using the following statement:

You have selected '+$('select option:selected').text());

which displays the text of the option that is selected from the select element

On execution, if we press Submit button without selecting any option from the select element, we get an error message ‘You have not selected any Option' as shown in below given figure :

 

Error message displayed if none option is selected from the select element

If we select any option from the list and select Submit button, we get the message showing the option selected as shown in below given figure :

The text of the selected option of the select element is displayed

This finishes my article on "Validating select element in jQuery"

 

For more information, refer my book : "jQuery Recipes A Problem-Solution Approach" available at : http://www.amazon.com/jQuery-Recipes-Problem-Solution-Approach-Development/dp/1430227095/ref=sr_1_1?ie=UTF8&s=books&qid=1287320549&sr=8-1

 

 

About the Author

B.M.Harwani is founder and owner of Microchip Computer Education (MCE), based in Ajmer, India that provides computer education in all programming and web developing platforms. He graduated with a BE in computer engineering from the of Pune, and also has a 'C' Level (master's diploma in computer technology) from DOEACC, Government Of India. Being involved in teaching field for over 16 years, he has developed the art of explaining even the most complicated topics in a straight forward and easily understandable fashion. He has written several books on various subjects that includes JSP, JSF, EJB, PHP, .Net,  Joomla, jQuery and Smartphones. To know more, visit his blog, http://bmharwani.com/blog

What is a smallest part of an element?

it's atom and in every atom there three componts-electron,proton and neutron...

Gary Oldman interview Cannes Fifth Element part 1

Tags: , , , , , , , , ,

This entry was posted on Saturday, September 5th, 2009 at 11:06 pm and is filed under Indoor Major Appliances. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.