Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7179519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:09:23+00:00 2026-05-28T17:09:23+00:00

I am trying to do something I think should be fairly simple, but I

  • 0

I am trying to do something I think should be fairly simple, but I am having erratic results. I want to open a dialog box and have 2 address fields in it that use the google maps autocomplete function to suggest locations based upon what the user has input. I am able to get the fields to show “Enter Location” which tells me the google maps api call is working but it is not auto completing addresses.

EDIT: OK I determined the problem. The drop down list of locations is ending up behind the dialog box and thus not visible. So can someone tell me how to change the z-index of either the query-ui dialog box and overlay or the google maps drop down box?

Here is a link to a sample I created since the actually form you need to register for the site to use. http://google.backcountryride.com/dialog_google_test.php

Here is my code:
The JQuery:

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places,geometry&sensor=false"></script>
<script type="text/javascript">
$(function() {

var post = $( "#post<?php echo $instance ?>" ),
    role = $( "#role<?php echo $instance ?>" ),
    allFields = $( [] ).add( post ).add( role),
    tips = $( ".validateTips" );

function updateTips( t ) {
    tips
        .text( t )
        .addClass( "ui-state-highlight" );
    setTimeout(function() {
        tips.removeClass( "ui-state-highlight", 1500 );
    }, 500 );
}

function checkLength( o, n ) {
    if ( o.val().length < 1 ) {
        o.addClass( "ui-state-error" );
        updateTips( n + " cannot be blank." );
        return false;
    } else {
        return true;
    }
}

function checkRegexp( o, regexp, n ) {
    if ( !( regexp.test( o.val() ) ) ) {
        o.addClass( "ui-state-error" );
        updateTips( n );
        return false;
    } else {
        return true;
    }
}

$( "#carpool-request<?php echo $instance ?>" ).dialog({
    autoOpen: false,
    height: 400,
    width: 400,
    modal: true,
    buttons: {
        "Send Message": function() {
            var bValid = true;
            allFields.removeClass( "ui-state-error" );

            bValid = bValid && checkLength( post, "Your message" );
            bValid = bValid && checkLength( role, "Your role" );

            if ( bValid ) {
                //window.alert('All clear!');
                document.forms["send_message<?php echo $instance ?>"].submit(); 
                $( this ).dialog( "close" );
            }
        },
        Cancel: function() {
            $( this ).dialog( "close" );
        }
    },
    close: function() {
        allFields.val( "" ).removeClass( "ui-state-error" );
    }
});

$( "#carpool-send<?php echo $instance ?>" ).click(function() { 
    $( "#carpool-request<?php echo $instance ?>" ).dialog( "open" ); 
    $(".address-field").each (function (ix, item) {
        var defaultBounds = new google.maps.LatLngBounds(
            new google.maps.LatLng(41.0000, -110.0000),
            new google.maps.LatLng(44.000, -112.0000));
        var options = {
            bounds: defaultBounds,
            types: ['geocode']
            //types: ['establishment']
        };
        var autocomplete = new google.maps.places.Autocomplete ($(item).get(0), options);
    }); 
});
});
</script>

The php to render the form:

<?php

//allow sending a message if not you
echo '<div id="carpool-request'.$instance.'" title="Request to join carpool">';
echo '<div id="dialog-form'.$instance.'">';
echo '<div id="dialog-form">';
echo '<p class="validateTips">All form fields are required.</p>';
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post" id="send_message'.$instance.'">';
echo '<fieldset>';
echo '<input type="hidden" id="subject'.$instance.'" name="subject" value="Join carpool request" class="text ui-widget-content ui-corner-all" />';
echo '<label>Please Provide Where You Will Be Traveling To and From</label>
      <label>Start Address:</label>
      <input type="text" class="address-field" id="address-start" name="addressStart" value="">
      <label>End Address:</label>
      <input type="text" class="address-field" id="address-end" name="addressEnd" value="">';
echo '<label>I am a </label>';
echo '<select name="role" size="1" id="role'.$instance.'" >';
echo '<option value="">Please Select</option>';
echo '<option value="D">Driver</option>';
echo '<option value="P">Passenger</option>';
echo '<option value="E">Either</option>';
echo '</select>';
echo '<label>Days you wish to join carpool</label>';
echo '<div id="days-week">';
echo Utility::carpoolDays($row_commuters['commuteId']);   
echo '</div>';
echo '<label>Will you pitch in for gas?</label>';
echo '<select name="gas" size="1" id="expenses" >';
echo '<option value="">Please Select</option>';
echo '<option value="Y">Yes</option>';
echo '<option value="N">No</option>';
echo '</select>';
echo '<label for="post" style="width:100%">Add a personal message</label>';
echo '<textarea name="post" id="post'.$instance.'" class="text ui-widget-content ui-corner-all" >';
if(isset($_POST['post'])) echo $_POST['post']; 
echo '</textarea>';
echo '<input type="hidden" name="driverId" value="' .$row_commuters['user_id'] . '" />';
echo '<input type="hidden" name="commuteId" value="' .$row_commuters['commuteId'] . '" />';
echo '<input type="hidden" name="tab" value="commute" />';
echo '<input type="hidden" name="process_carpool_request" value="process" />';
echo '</fieldset>';
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<a href="javascript:void()" id="carpool-send'.$instance.'">Ask to join this carpool</button>';
echo '<br/>';
?>

Thanks in advance for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:09:24+00:00Added an answer on May 28, 2026 at 5:09 pm

    So I figured out what class the div was that included the drop down list and I added this to my css file:

    .pac-container {
        z-index: 1200 !important;
    }
    

    pac-container being the div class applied by google maps to its drop down lists for autocompetes. By using the !important modifier I was able to overrule the element style and set the z-index higher than the z-index set by the query ui for its dialog boxes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to do something that I think should be fairly simple but I've
I'm trying to get this simple PowerShell script working, but I think something is
I'm trying to do something that I think should be pretty straightforward but I
I'm trying to do something fairly simple, but for the reason of me probably
I am trying something very simple, but for some reason it does not work.
I'm a novice Python user trying to do something that I think should be
I'm having an issue mapping what I would think is a fairly simple association.
maybe what I'm trying to achieve is a non-sense, but I think it should
So, this is a fairly simple thing I'm trying to accomplish (javascript), but it's
I'm trying to find a way to to do something that I think must

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.