SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Issue with dropdown list (unordered) and iPhone (can't click)

    Just did a quick overhaul for a client and the designer boxed me into some things I didn't want to do, now I have an iPhone issue.

    The site is ahuntinglease.org

    In the free quote box you will see a box for property state, as they type I dynamically grab states (that match what they are typing) via an AJAX call, the results show being an unordered list. When the user clicks the state they want it fills in the text box (along with a hidden field for the county AJAX).

    The owner just emailed me saying the states show but you can not 'click' on a state (yes I realize you don't click on an iPhone).

    Here's the code that drives this:

    Code:
    	$('#quote_state').keyup(function()	{
    		
    		if (jQuery.trim($(this).val()).length != 0)	{
    			
    			$('#state_drop').remove();
    
    			$.ajax({  
    				async: false,
    				type: 'POST',  
    				url: '/functions/get_states.php',  
    				data: '&letters=' + $(this).val() + '&which=state',  
    				success: function(data, textStatus){
    					$('#quote_state').after(data);
    					}  
    				}); 
    			
    			}
    		else	{
    			$('#state_drop').remove();
    			}
    
    		});
    
    	$('.st_dr').live('click', function()	{
    		$('#quote_state').val($(this).html());
    		$('#state_abbr').val(str_replace('st_', '', $(this).attr('id')));
    		$('#state_drop').remove();
    		});
    Tried to research it but can't find anything similar to what I'm doing here so what the heck do you use to make these phones work right on this?

    thanks

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,214
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by dc dalton View Post
    Tried to research it but can't find anything similar to what I'm doing here
    There are lots of discussions online about the click event not working properly on iPhones, but there are fixes, such as here:

    https://wiki.base22.com/display/btg/...esn't+work

    (Not sure if that helps. I admit I'm not a jQuery chap. )


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
  •