www.webdeveloper.com
Results 1 to 2 of 2

Thread: Jquery client side yes/no conflict

  1. #1
    Join Date
    Apr 2012
    Posts
    9

    Jquery client side yes/no conflict

    Code:
    <!-- Start Sub Acc 1 -->
    	<p>Item Returned</p>
    	<p class="yesno">No</p>
    <!-- End Sub Acc 1 -->
    
    <!-- Start Sub Acc 2 -->
    	<p>Item Returned</p>
    	<p class="yesno">Yes</p>
    <!-- End Sub Acc 2-->
    				
    				
    $(function () {
    	if($.trim($('findswithflo.html, .yesno').text()) === "No") {
    		$('findswithflo.html, #floalert').show();
    	} else {
    		$('findswithflo.html, #floalert').hide();
    	}
    });
    Help needed please. Go easy I’m not that god at explaining things.
    If one class element contains “No” as the text the “floalert” div is shown and if changed to “Yes” then the “floalert” div is hidden. All ok at this point using one set.
    The problem starts as soon as I add a second set using the same element and class containing the opposite yes/no to the first. The “floalert” div is still hidden.
    So one is telling “floalert” to hide and the other to show at the same time. I may need to use many elements with the same class for yes/no answers. Help appreciated

    Henry

  2. #2
    Join Date
    Apr 2012
    Posts
    9
    Thanks,

    Problem now solved. Went round it a different way without the yes/no side of things.

    Henry

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles