Skip to:
Content
Pages
Categories
Search
Top
Bottom

ShortCodes and Form Fields – Geolocation


  • maddogmcewan
    Participant

    @maddogmcewan

    I have installed a plugin called WP-Geolocation (http://www.wp-geolocation.com/) which allows me display the following shortcode (see list at end) on any post and page. I was trying to add these shortcodes or javascript variables (handles both) INTO a 3 form fields called County, City and region.
    using the php echo do shortcode commands… well i can echo anywhere in the code, but do you think I can “echo” INSIDE a form text field??

    In normal HTML or ASP this is a breeze, why is it so difficult in WP to do this? I mean the variable is there and available on every page and post (runs in header), why can i not have form value php echo do_shortcode (had to tweak that to display here) and have the field filled in on the registration form.

    For us it is essential to have the users’ location at sign up, preferably I would like to use buddypress Xprofile fields to display the field at signup and the allowing the variables or shortcode to auto poulate the field… I have tried so many things, bought gravity forms, tried Formidable… no luck, something so simple…

    The best plugin that anyone could develop for BuddyPress would be a better X Profile Fields Editor, allowing you to specify a SHORTCODE or variable right there and then…

    Anybody want to make a quick buck and sort this for me, as i have spent 2 days JUST trying to get this done, crazy… my skype is greg.mcewan.marriott and my email greg@imediate.co.za

    The variables are there, just “put them” INSIDE the form field…

    VARIABLES
    ===========

    Within any blog post or page, you can use the following shortcodes:

    [mmjs-countrycode] – the ISO 3166-2 country code
    [mmjs-countryname] – the country name
    [mmjs-city] – the city name
    [mmjs-region] – the ISO 3166-2 country code (state or province abreviation)
    [mmjs-regionname] – the region name
    [mmjs-lat] – latitude
    [mmjs-long] – longitude
    [mmjs-postalcode] – post/zip code
    [mmjs-ip] – ip address

    The plugin also generates corresponding JavaScript variables in your theme for use with JQuery, dynamic forms, etc:

    mmjsCountryCode
    mmjsCountryName
    mmjsCity
    mmjsRegion
    mmjsRegionName
    mmjsLat
    mmjsLong
    mmjsPostalCode
    mmjsIPAddress

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ShortCodes and Form Fields – Geolocation’ is closed to new replies.
Skip to toolbar