django-location-field
django-location-field copied to clipboard
Can I hide the input (id_location) box but retain the others?
Hopefully a simple one, but I am struggling to hide one of the input boxes. Does anyone have any advice?
Not the cleanest, but assuming your field is called location
, add to your template:
<script>
$( document ).ready(function() {
document.getElementById('id_location').style.display = "none";
});
</script>
Thank you!
Thanks @iragm . But when I use JavaScript or CSS to hide id_location, even the map is not visible. @tim-blackmore
Make sure you are not hiding the whole div -- div_id_location_coordinates
will hide everything. The above code works for me. Post code from your model and template.
or add something like this in your css file
form input#id_location {display:none;}
replace "id_location" with the input id off course
want to hide the label text then add something lik this to your css file
form label[for="id_location"] {display:none;}