0
我想取的值進入領域street address
,city
,state
,並且zipcode
,然後使用這些值來填充隱藏字段longitude
和latitude
。生成緯度/經度從輸入字段之前提交
我很想做的一個例子可以看到here,我只是想用多輸入字段來做。
內value=" "
的{...}
對於CMS expressionengine因此它可以被忽略
表單字段:
<div class="formsection clearfix">
<label for="trainer_address">Street Address</label>
<span class="directions">This will NOT be displayed in your listing. Only for search Purposes.</span>
<input type="text" name="trainer_address" id="trainer_address" value="{trainer_address}">
</div>
<div class="formsection clearfix">
<label for="trainer_city">City</label>
<span class="directions">The city to be displayed in your listing.</span>
<input type="text" name="trainer_city" id="trainer_city" value="{trainer_city}">
</div>
<div class="formsection clearfix">
<label for="trainer_state">State</label>
<span class="directions">The state to be displayed in your listing.</span>
<select name="trainer_state">
{options:trainer_state}
<option value="{option_value}"{selected}>{option_name}</option>
{/options:trainer_state}
</select>
</div>
<div class="formsection clearfix">
<label for="trainer_zip">Zip Code</label>
<span class="directions">The zip code to be displayed in your listing.</span>
<input type="text" name="trainer_zip" id="trainer_zip" value="{trainer_zip}">
</div>
下面是隱藏的緯度和經度字段:
<input type="hidden" id="trainer_longitude" name="trainer_longitude" value="{trainer_longitude}" />
<input type="hidden" id="trainer_latitude" name="trainer_latitude" value="{trainer_latitude}" />