9 years ago
8
Topic

Bonjour,

J'aimerai ajouter un champ qui me permette d'ajouter une case à cocher + un lien pour afficher un article joomla qui décrirait les termes & conditions de l'inscription sur le site...La case à cocher et le lien à cliquer (qui s'ouvrira dans une fenêtre modale).

I'd like to add a field (checkbox) to allow to confirm that "terms & conditions" (link) are read before submitting the forms.

ex :

Termes & conditions   [ ] je confirme avoir lu les termes et conditions d'inscription au site.(I have read terms & conditions)

[ ] est une case à cocher (is a checkbox)

termes et conditions un lien qui s'affiche en modal (link to be opened in modal window)

J'ai lu beaucoup de doc et de post sur les forums mais je bloque sur plusieurs point notamment celui-ci. (i've read lot of docs but i have not found how to do it)

Je suis preneur de n'importe quelle autre façon de faire du moment que ça soit efficace et bien fait. (any other way to get the same result can fit me)

Merci pour votre aide.(thanks for your help)

Thierry

Get a VIP membership
1283 Posts
Bucklash
9 years ago
4
Level 1

Hi Thierry

Sorry for replying in English.

I studied French all through school and got an "F"! Stupid, eh

 

I would use field {Select Simple}

As the label "Have you read T&C.s?" (or maybe put text as field {Free Text}).

For the Select Simple Text=Value options I would have:

Yes=1

No=0

For the Submit Button, add a conditional State [5], something like:

This Field [is enabled][ ][#form#] [checkbox checked] WHEN [and] [select_simple_field][is equal][1]

Hope that makes sense, hope it works, and hope it helps

   

Bucklash

9 years ago
3
Level 2

Thanks Bucklash !!

Good idea to hide/desactivate the button if condition is not checked.

But how to add a link to an article just on the right of the select listbox (yes/no). what is the parameter (css ?) to put both fields on the same ligne.

I want the user to click on the link to open a modal and read an article containing the terms&contents.

Thanks if you can help me again

Thierry

1283 Posts
Bucklash
9 years ago
2
Level 3

Hi Thierry

As far as inline goes, that depends on the markup around your content and the template css.

It sounds to me like you need to create template or position overrides, and modal depends on your modal script. 

Pretty soon I will be doing exactly the same using bootstrap 3 or roksprocket, not sure yet.

so what css you using: Bootstrap? 2? 3? etc

What script handles the modal? Bootstrap? Roksprocket? etc

These links might be helpful:

open-seb-one-modal-position-in-modal
create-slideshop-in-bootstrap-themes-from-field-x

Bucklash

9 years ago
1
Level 4

thanks for the answer. 

I'm using Joomla! 3.4.5 + template jsn MICO pro so bootstrap 3 I suppose..

In the example,I want to display a link (in blue in the picture) just close to the select box =>

1) how to define a link to an article ?

2) how to put it on the same line ? do I have to put these 2 fieds in a div with a css parameter in option 6 ?

3) do I have to add something in the option 6 of the fields (or in the fields description) to open a modal when I click on the link ? 

4) do I have to copy/paste jQuery('#collapseModal').modal('show'); somewhere ?

Sorry,I understand nothing...seem to be stupid :-(

5) one extra question : how to add tooltips to labels of the form ?

I have variation seb_css3, I had set in the template :  in fields => description Popover ? is it not enough ?

Thanks a lot

1283 Posts
Bucklash
9 years ago
0
Level 5

Hi Thierry

First off, I have replied previously and suggested using third party product for the modal, but it is so much easier to use the JS that is shipped with Seblod. Being ashamed, I apologise to the Seblodiverse and WILL use Seblod's JS.

You seem to be using an old template, not sure if the demo is representative of JSNMico now, but I doubt it has Bootstrap 2, or 3 anyway. JSN used their own framework. Maybe still do.

So, this is the requirement:
In your Form (Admin Form (and/or) Site Form view), you want a Checkbox that needs checking in order to complete the Form.
Next to the Checkbox is a link which opens a Modal window. This Modal window contains an Article (Content view) [Terms And Conditions].

Terms and Conditions Article

First step is to create your Terms and Conditions Article. I imagine you just need a title, alias, catid and fulltext field.
When it is saved, note the Article Id.

List and Search Type

Next, you need to add the 'Terms and Conditions' Article (Content view) to your Form.

I used a List and Search Type to grab the Article:

Create a List and Search Type:

What kind of items are you searching for?:
Article
How do you want to display these items?
Blog

In the Search Form View, the Field "CCK" will have a Live value of "article".

Add a field to grab the id of the article you want, there already exists the "Article Id" field, add it (or recreate it), and set the live value to the id of the Terms and Conditions Article ie 29 or whatever it is.

I am using the template Blog - Seb Blog (for no particular reason other than it was already the template being used).
I also used the Item View rather than the List View. If the Item View is not 'clickable', click the List View Button, then the Item view will become available (might have to save first).

In the Item View I put in the fields Title and Fulltext.

I then put the List and Search Type in the Form:

In your Form, add a List field.
Select the List and Search type just created by putting in the machine name ie my_tandc_search_type or whatever you called it.
Place this field in the Modal Position in the template.

T&C Button

Next step is to install a FREE (no cost) plugin: Custom (JS)

I know this because I read this: open-seb-one-modal-position-in-modal

Create a new Field, type Button Free

The Button's settings:

  • Title: whatever you want
  • Name: whatever you want
  • Type: Free
  • Label: whatever you want
  • Label Icon: whatever you want
  • Button: either works, but I chose button to be safe
  • Link: Javascript - Custom (click the plus sign that appears)
    • COM_CCK_Javascript: jQuery('#collapseModal').modal('show');
  • Show Alternative: Hide, otherwise you want to have an additional clicking option

Place this field in your form where required (not in modal position)


Go to your form and check it out!!

Checkbox

For your checkbox, add a new checkbox field, and as options:

  • Yes=1 (not sure if a No=0 would be needed)

For the default value I put 0.

Add your conditional statement if required to your submit button:

This Field [is enabled][ ][#form#] [checkbox checked] WHEN [and] [funky_checkbox_field][is equal][1]

Hope that helps

Bucklash

8 years ago
1
Level 1

I would like to thank you Bucklash!

Very usefull tutorial!

1283 Posts
Bucklash
8 years ago
0
Level 2

Hi Dantd

Thanks :)

It's a bit long winded - might even be wrong in some places, too!

Bucklash

4229 Posts
Kadministrator
8 years ago
0
Level 1

You could make this a tutorial (in tutorials section).

Get a VIP membership