function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mike McGeoyMike McGeoy 

Can I populate Lead State and Country fields from web-2-lead forms without special code

First, we do not have State and Country Picklists turned on in SF...

We have a Web-2-lead form which currently works fine but given that the Address fields on Leads are text fields the user can type garbage in those fields and they will populate once the form is submitted.  We recently modified the html code to force the user to select values from dropdowns in the form for State and Country with the hope that these would populate the fields on the Lead in SF.  It doesn't work, all fields with the exception of the State and Country fields come over.  

So now the questions:  Is what we are trying to do possible without creating special code or enabling State and Country picklist?  And the follow-up question is why would the fields in SF not just accpet the text that is derived from the option value coming from the webform?

Here is a snippet from the web-2-lead form showing how we are trying to write to the State and Country fields on the Lead.
 
<form id="partner-deal" class="" action="https://wwwcrm.skyhigh.myshn.net/servlet/servlet.WebToLead?encoding=UTF-8" method="POST"><input name="oid" type="hidden" value="00D90000000iXNc" />
    <input name="retURL" type="hidden" value="https://www.skyhighnetworks.com/partner-deal-registration/thank-you-partner-deal-registration" />

    <label for="company">* Company:</label>
    <input id="company" class="required" maxlength="40" name="company" size="20" type="text" />

    <label for="first_name">* First Name:</label>
    <input id="first_name" class="required" maxlength="40" name="first_name" size="20" type="text" />

    <label for="last_name">* Last Name:</label>
    <input id="last_name" class="required" maxlength="80" name="last_name" size="20" type="text" />

    <label for="title">* Title:</label>
    <input id="title" class="required" maxlength="40" name="title" size="20" type="text" />

    <label for="email">* Email:</label>
    <input id="email" class="required valid-email" maxlength="80" name="email" size="20" type="text" />

    <label for="phone">* Phone:</label>
    <input id="phone" class="required valid-phone" maxlength="40" name="phone" size="20" type="text" />

    <label for="street">* Street:</label>
    <input id="street" class="required" maxlength="100" name="street" size="20" type="text" />

    <label for="city">* City:</label>
    <input id="city" class="required" maxlength="40" name="city" size="20" type="text" />

 <label for="country">* Country:</label>
    <div input id="country" class=" control-wrap-select"> <select id=" country" class="required" title="Country" name=" country"><option value="">--None--</option>
            <option value="United Kingdom">United Kingdom</option>
            <option value="United States">United States</option>
            <option value="-----">-----</option>
            <option value="Afghanistan">Afghanistan</option>
            <option value="Albania">Albania</option>
            <option value="Algeria">Algeria</option>
            <option value="American Samoa">American Samoa</option>
            <option value="Andorra">Andorra</option>
            <option value="Angola">Angola</option>
            <option value="Anguilla">Anguilla</option>
            <option value="Antigua and Barbuda">Antigua and Barbuda</option>
            <option value="Argentina">Argentina</option>
            <option value="Armenia">Armenia</option>
            <option value="Aruba">Aruba</option>
            <option value="Australia">Australia</option>
            <option value="Austria">Austria</option>
            <option value="Azerbaijan">Azerbaijan</option>
            <option value="Bahamas">Bahamas</option>
            <option value="Bahrain">Bahrain</option>



 <label for="state">* State/Province:</label>
    <div input id="state" class=" control-wrap-select">            <select id=" state " class="required" title="State/Province" name=" state">
            <option value="">--None--</option>
            <option value="AK">AK</option>
            <option value="AL">AL</option>
            <option value="AR">AR</option>
            <option value="AZ">AZ</option>
            <option value="CA">CA</option>
            <option value="CO">CO</option>
            <option value="CT">CT</option>