Lat/Lon Input Field Validation Bug

This topic contains 12 replies, has 8 voices, and was last updated by  Y A 5 years, 6 months ago.

  • Author
    Posts
  • #7405

    Greg Mount
    Free User
    Post count: 82

    Here’s an interesting little bug: on the add listing page, a user can enter text in one of the lat/lon fields and it breaks the hell out of the interface. Discovered when a user mistakenly entered a street address in the lat field.

    Quick fix would be to validate for numeric input only (including “.” and “-“, of course).

    #7415

    purpleedge
    Expired Member
    Post count: 539

    I’m not sure why they need to be there at all. Can they be hidden?

    #7420

    Greg Mount
    Free User
    Post count: 82

    @purpleedge Good point. Perhaps an option to hide for all but admin users would work. End users don’t need to see lat/lon coordinates in an otherwise pretty clean form.

    #7421

    Paul
    Full Member
    Post count: 171

    option to display or hide from admin would definitely improve the input which has got to be a good move.

    #7425

    pix3x
    Expired Member
    Post count: 155

    +1
    Have you tried to hide it with CSS “display:none”?

    #7427

    Vikas
    Full Member
    Post count: 1128

    Hi,

    I have implemented validation there.

    #7428

    purpleedge
    Expired Member
    Post count: 539

    Hi Vikas, what does that mean? Can the fields be hidden, or not?

    #7470

    Paolo
    Site Admin
    Post count: 31205

    @Vikas can you please also add unique classes or better IDs to the html of the add listing form?

    Now every row has an identical class and make’s it impossible to hide with css.

    This :

    <div class="required_field geodir_form_row clearfix">
    					<label></label>
    					<input>
    					<span class="geodir_message_note"></span>
    										<span class="geodir_message_error"></span> 
    									 </div>

    Should be :

    <div <strong>id="geodir_lat_input"</strong> class="required_field geodir_form_row clearfix">
    					<label></label>
    					<input>
    					<span class="geodir_message_note"></span>
    										<span class="geodir_message_error"></span> 
    									 </div>

    This way we could use #geodir_lat_input {display :none;}

    to fix this problem simply and quickly…

    I’ve added this task in the project maanger too.

    Thank you,

    #7475

    Greg Mount
    Free User
    Post count: 82

    @paolo +1 for this. An even better solution would be to remove the fields for front end users. I doubt they will ever need to enter lat/lon coordinates, so why present the fields?

    #7477

    directory
    Expired Member
    Post count: 1502

    Hi Greg,

    I am not sure if removing the lat/long fields is a good idea. I think many Non-US users will need this option but I may be wrong.

    #7478

    Greg Mount
    Free User
    Post count: 82

    @manilaboy I’m in Canada, but I get your point. 😉

    To be clear, I’m recommending that the fields be toggleable in the admin interface, not permanently removed. This way admins can decide if end users should see the fields or not. Why? It’s better to not print a field at all than to print and then hide it with css.

    +1 if you want the lat/lon fields off the end user interface?

    #7479

    directory
    Expired Member
    Post count: 1502

    Thank you, Greg.

    +1 for an admin option.

    #29006

    Y A
    Expired Member
    Post count: 156

    Has this issue been addressed? I would also like to hide Lat/Lon coordinates in the front-end.

Viewing 13 posts - 1 through 13 (of 13 total)

The topic ‘Lat/Lon Input Field Validation Bug’ is closed to new replies, this may be for inactivity, please open a new topic if you have a similar question.