Add javascript to handle input of a pair of geo coordinates and move longitude to second field
This commit is contained in:
parent
05bc59f319
commit
2df9903938
|
@ -62,7 +62,18 @@
|
|||
<%- if not self.cancel then -%><%-:Cancel-%><%-else-%><%=self.cancel%><%end-%>
|
||||
" />
|
||||
<% end %>
|
||||
<script type="text/javascript">cbi_d_update();</script>
|
||||
<script type="text/javascript">
|
||||
cbi_d_update();
|
||||
window.onload = function() {
|
||||
var spread_latitude = document.getElementById('cbid.wizard.1._latitude');
|
||||
var spread_longitude = document.getElementById('cbid.wizard.1._longitude');
|
||||
spread_latitude.addEventListener('change', function() {
|
||||
p=spread_latitude.value.trim().split(/[ ,]+/);
|
||||
spread_latitude.value = p[0];
|
||||
spread_longitude.value = p[1];
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</form>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue