PDA

View Full Version : Using && operation in Javscript



letom
02-11-2013, 01:46 PM
Hey Friends

Briefly I Explain my program :- I Have 3 select boxes ..

If the value selected by the user in the 1st box is 2 & Value selected by the user in second box is 3 (option values)

then the third select box should display an array .

For this my incorrect coding is as follows

if $('#firstbox').click(function()
{($(this).val() == '2') })

&&

$('#secondbox').click(function()
{($(this).val() == '3') })

{
Array Display here (not included the coding here, because there is no issue with this coding.. seems working fine)
}

I need help for the red coding part in && operation for checking the expression, that seems to be wrong

Thanks

jscheuer1
02-11-2013, 09:19 PM
$('#firstbox, #secondbox').change(function(){
if($('#firstbox').val() == '2' && $('#secondbox').val() == '3'){
//Array Display here (not included the coding here, because there is no issue with this coding.. seems working fine)
}
});