Results 1 to 2 of 2

Thread: Using && operation in Javscript

  1. #1
    Join Date
    Jul 2012
    Posts
    198
    Thanks
    54
    Thanked 3 Times in 3 Posts

    Default Using && operation in Javscript

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    $('#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)
    	}
    });
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Uploading Javscript to a website??
    By pyros in forum JavaScript
    Replies: 4
    Last Post: 08-08-2011, 04:23 PM
  2. Can javscript run a php file?
    By crobinson42 in forum JavaScript
    Replies: 3
    Last Post: 09-11-2010, 03:45 PM
  3. Javscript Popup message like MSN
    By Lallerup in forum JavaScript
    Replies: 0
    Last Post: 08-31-2007, 02:06 AM
  4. Javscript Special Effect won't execute
    By msualumni in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 08-09-2006, 05:47 PM
  5. javscript/html query!
    By ans1 in forum JavaScript
    Replies: 3
    Last Post: 07-17-2005, 03:06 PM

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
  •