• Resolved bcanr2d2

    (@bcanr2d2)


    I’m currently using v 1.2 of this plugin, and noted that it creates a hidden pp_*fieldnumber*_geocode input on the edit page form.

    Is there anyway to see if this field is populated (ie the user has selected a legimate address from the Google autocomplete) and stop the form submitting?

    I was thinking of perhaps one on change on the field in question, or on submit.

    Is this something that could be looked at for the plugin, or a suggestion on how to acheive.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author shanebp

    (@shanebp)

    You could check if a value has already populated that field.
    Try adding a conditional to this js function: google.maps.event.addListener before the getPlace() call.

    Thread Starter bcanr2d2

    (@bcanr2d2)

    I got my request around the wrong way!

    I was trying to make sure the user selects a place from the drop down, and can’t submit the profile details until they have successfully used an autocomplete address

    A quick guess at the code would be:

    var has_geocode = document.getElementById(‘pp_<?php bp_the_profile_field_id(); ?>_geocode’).value
    if (has_geocode==”) {
    return false;
    }

    or along that line, I am not that good with JS and getting it to do what I need it to do

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Force user to autoselect’ is closed to new replies.