Skip Navigation

[Résolu] Address Fields placeholder and view in CRED Forms

This support ticket is created Il y a 6 années et 9 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Ce sujet contient 8 réponses, a 2 voix.

Dernière mise à jour par Ljuba Il y a 6 années et 9 mois.

Assisté par: Christian Cox.

Auteur
Publications
#620202
Selection_02.png
Selection_01.png

Address Field is basically without settings. Main issue is how to display it on CRED, in sense to appear map by itself, when geolocation is not available (for HTTPS lack).

So, I set in CRED value of initial point as:

<div class="form-group">
<div style="color: #034ea2;"><label>[wpml-string context='cred-form-Formulario de sitios-34' name='Ubicación del sitio']Ubicación del sitio[/wpml-string]</label><span style="color: #ed1c24; font-weight: 900;"> *</span></div>
<p><span style="color: #666666;">Puede aumentar el nivel de enfoque del mapa y afinar al máximo la ubicación del sitio.</span></p>
[cred_field field='ubicacion-del-sitio' post='sitio' value='{-0.4615292821230493,-80.45515763523065}' urlparam='' class='form-control' output='bootstrap']
</div>

and I have initial look as on shot 1 (map is active/visible), what is perfect), but it should to be like in shot 2 (see placeholder). It appear like in shot 2, when I click on placeholder.

Hopefully, it is clear.

How to achieve that?

#620209

I forgot to mention one important and negative side effect of inserting value in CRED.

When I check in Fields settings as obligatory field, problems appears if user will not change value (pointer) and I don't know how to solve it (also).

In other words, it looks that my idea to get the map in CRED by setting the value is not exactly the 'great idea'.

#620287

Main issue is how to display it on CRED, in sense to appear map by itself, when geolocation is not available (for HTTPS lack).
CRED does not have a JavaScript API available, so the amount of customization here is very limited. You can predefine a value in the cred_field shortcode, but there is no setting to show the map without a value.

and I have initial look as on shot 1 (map is active/visible), what is perfect), but it should to be like in shot 2 (see placeholder). It appear like in shot 2, when I click on placeholder.
The only way to show a map with a marker when the page loads is to define the value attribute in the cred_field shortcode. You can use the latitude and longitude, or you can use any geocode friendly address like "Calle Javier Santos, Canoa, Ecuador".

[cred_field field='ubicacion-del-sitio' post='sitio' value='{-0.4615292821230493,-80.45515763523065}' urlparam='' class='form-control' output='bootstrap']

or

[cred_field field='ubicacion-del-sitio' post='sitio' value='Calle Javier Santos, Canoa, Ecuador' urlparam='' class='form-control' output='bootstrap']

When I check in Fields settings as obligatory field, problems appears if user will not change value (pointer) and I don't know how to solve it (also).
Can you provide more details about the problems? Screenshots will be helpful. I tested this on a live site here:
lien caché

I have sent you a login invitation so you can test as well. The Address field is required, and I have provided a default latitude / longitude value. If I fill out all the other information in the form, but do not change the Address, I am able to save the new Tour post correctly. The Address appears in the post's custom fields in wp-admin.

#620288

Sorry I just realized the invitation will not work unless you sign up for an account at discover-wp.com. Let me know if you have an account and would like to test the CRED form.

#620327

"The Address field is required, and I have provided a default latitude / longitude value. If I fill out all the other information in the form, but do not change the Address, I am able to save the new Tour post correctly. The Address appears in the post's custom fields in wp-admin."

That is exactly what I wrote and that is WRONG.

It mean (assuming that default pin is Central Park) that if visitor forget to 'FIX' location coordinates, form will be proceeded with 'success' as default value is already inserted and I will get (expression) thousands of hotels in Central Park (at exact same place).

From other side, if default coordinates are not inserted via CRED shortcode, map appear GRAY and most visitors will be confused what to do.

So, point is - How to force visitor to move the pin from default coordinates (checking 'obligatory' will not do it - we already agree about it)?

#620641

Sorry but the Address field does not work like this. It is not designed to show a map unless the User selects an Address, or specifies their own location. If HTTPS is not available, and the value attribute is not predefined in the cred_field shortcode, it is not possible to show a map until something is entered by the User in the input field. CRED does not offer a JavaScript API, so there's not much we can do to customize this feature right now. If this is important to your project, then I can suggest this as an improvement, or feature request, to our developers. I can't guarantee they will implement it, but I can request it.

#620672

Well, I think that it is very important feature, as that is completely different from auto-located user. Example, tour info website and visitor from France is in New York page. It not sounds logical to open map of France (by auto-location) when he want to add listing of his property in New York - right? New York pages should to open New York map (or I'm wrong)?

So, I didn't asked nothing else than that - how to do it?

BTW - is it mean that if I have SSL and set HTTPS address of website, visitors will get opened they own location in the map (with or without sking them for permission?)?

#620730

So, I didn't asked nothing else than that - how to do it?
The answer is you cannot do it.

#620741

OK, thanks.