Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Nick Ciske

    (@nickciske)

    Not at present. You could use jQuery to change the submit button value.

    I’ll add it to the wish list for future versions.

    Thread Starter charma@hotmail.com

    (@charmahotmailcom)

    Hi Nick,

    Thanks for the tip. I’m not too familiar with coding, so can you direct me to how I can use jQuery to accomplish this? I hope this won’t take take up too much of your time. But I’m sure other users will want to know about this.

    By the way, when do you expect a next release? (ballpark date would be good for me). =)

    Thanks!
    Charles

    Plugin Author Nick Ciske

    (@nickciske)

    Place the relevant portion of the snippet below either the form short code (in HTML mode, not Visual mode), or in an empty text widget at the bottom of the sidebar containing the SF widget (if your theme styles empty widgets, use an option below).

    If your theme has a spot to put javascript in the footer, you can use that as well.

    Or, use this plugin to add the script to the relevant pages:
    http://wordpress.org/extend/plugins/css-javascript-toolbox/

    <script>
    // Shortcode
    jQuery("#salesforce_w2l_lead_1 .w2linput.submit").val("Your Text Here");
    
    //Widget
    jQuery("#salesforce_w2l_lead_1_sidebar .w2linput.submit").val("Your Text Here");
    </script>

    Change the 1 to the ID of the form you’re targeting. Copy and paste lines to target multiple form IDs.

    Plugin Author Nick Ciske

    (@nickciske)

    RE: Next release – no date set yet.

    Thread Starter charma@hotmail.com

    (@charmahotmailcom)

    Hi Nick,

    I just tested the code you provide and it worked perfectly! I want to thank you again for the awesome plug-in, and even better support!

    I’m extended your code to capture ip address of the form submitter by using:
    jQuery("#salesforce_w2l_lead_1 .w2linput#sf_IP_Address__c").val("<?php echo $_SERVER['REMOTE_ADDR']; ?>");

    This works great.
    But now I want to get even more fancy. I want to add form submitter region in the form.
    I’m using this code I found online:

    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
        <script type="text/javascript">
        function geoTest() {
            if (google.loader.ClientLocation) {
                var latitude = google.loader.ClientLocation.latitude;
                var longitude = google.loader.ClientLocation.longitude;
                var city = google.loader.ClientLocation.address.city;
                var country = google.loader.ClientLocation.address.country;
                var country_code = google.loader.ClientLocation.address.country_code;
                var region = google.loader.ClientLocation.address.region;
                var text = 'Your Location<br /><br />Latitude: ' + latitude + '<br />Longitude: ' + longitude + '<br />City: ' + city + '<br />Country: ' + country + '<br />Country Code: ' + country_code + '<br />Region: ' + region;
            } else {
            var text = 'Google was not able to detect your location';
            }
            document.write(text);
        }
        geoTest();
        </script>

    But I can’t seem to call the function nor the variables using:
    jQuery("#salesforce_w2l_lead_6 .w2linput#sf_Region__c").val(geoTest());

    Love to hear your suggestions. And I hope my code above can help others.

    Thank you,
    Charles

    Thread Starter charma@hotmail.com

    (@charmahotmailcom)

    Alright! I think I solved it! Here are the code if anyone is interested:

    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
        <script type="text/javascript">
        function geoTest() {
            if (google.loader.ClientLocation) {
                var latitude = google.loader.ClientLocation.latitude;
                var longitude = google.loader.ClientLocation.longitude;
                var city = google.loader.ClientLocation.address.city;
                var country = google.loader.ClientLocation.address.country;
                var country_code = google.loader.ClientLocation.address.country_code;
                var region = google.loader.ClientLocation.address.region;
                jQuery("#salesforce_w2l_lead_1 .w2linput#sf_city").val(city);
                jQuery("#salesforce_w2l_lead_1 .w2linput#sf_state").val(region);
                jQuery("#salesforce_w2l_lead_1 .w2linput#sf_country").val(country_code);
            } else {
            var text = 'Google was not able to detect your location';
            }
        }
        geoTest();
        jQuery("#salesforce_w2l_lead_1 .w2linput#sf_IP_Address__c").val("<?php echo $_SERVER['REMOTE_ADDR']; ?>");
        </script>
    <script>

    It works ok on PCs, but it’s not working on my iphone. So I think it’s a problem with Google’s api.

    Plugin Author Nick Ciske

    (@nickciske)

    That means that your phone’s IP can’t be geolocated using that API (it’s likely only for fixed IPs where they know roughly where each IP is actually allocated – e.g. home or business broadband).

    If you were on wifi I’d guess it’d work, but not on 3G/4G. You can ask for their location via JavaScript but that requires the pop-up authorization on iOS (“this website would like yo use your current location”).

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Individual submit button text’ is closed to new replies.