Jump to content

How to use lat/lon as read only?


Christopher Ambler

Recommended Posts

I have enabled mapping for my listings, and I have a field group for the fields specified in geomaps (address, city, postal code, state, country). I also have two fields for latitude and longitude.

 

This all works perfectly - a user puts in as much of their location as they want, they click "map it" and the map populates the latitude and longitude fields.

 

The problem is that some users are idiots, and they try to fill in the latitude and longitude fields. They get confused.

 

I would like these fields to be hidden or, at worst, read-only.

 

If I hide them from all user types, will they still be put into the form? And if I hide them, how will the user know that their mapping has been used? Right now, seeing these fields filled in is an indicator that they did it right, especially with the red asterisk (meaning "required") next to them. But I don't want the user to be able to modify the fields!

 

What would be IDEAL would be if there were a way to hide the latitude and longitude entirely, but still have them in the form (could be done with a display: hidden in the CSS?) and also some kind of visual indicator that they've been set. Maybe some JQuery that checks a read-only checkbox entitled "Location Set" when latitude and longitude have a value?

 

But you see my problem? At the least, I need those fields to be read only so my users don't screw with them.

Link to comment
  • 4 months later...
×
×
  • Create New...