mysql database query in element (select from list)

  • Posts: 1465
  • Karma: 48
  • Thank you received: 194

mihaela replied the topic: mysql database query in element (select from list)

Hello again,

I'm glad that the previous solution worked properly.

Here are instructions for the new requests.

1) You have to check the database to query if there are two same names / telephone number. I suggest that you check for only one field rather than two because it is much simpler.
I will give you an example so you can recreate it for your own form.

I'm sending you an example form of AJAX email validation. Unzip it and install the package as explained here crosstec.org/en/support/online-documenta...ted/94-packages.html .

It checks whether the entered email is already in the database and if it is the error message is displayed and the form is unable to submit.

To see how this works, try submitting the form twice with the same email address.

You can see the code which makes this work in Validation section in Properties and Actionscript in Advanced Properties of the Email element. The rest of the code you can find in form's Advanced options > More options in "Form pieces" and "Submit pieces".

2) To do so you have to make some sort of calculation script. You have to go to Advanced properties of that "Nascimento" field and and in Actionscript section set Type to Custom and check the Change checkbox.
There you have to write the script that will calculate the age, you can scroll through the form since there are similar topics there or look on the Internet for Javascript code for that.
You can take a loot at this example crosstec.org/en/forums/1-forums/124319-age-calc-bf.html#227218 or this one crosstec.org/en/forums/3-breezingforms-f...ng-field.html#229637 .

Depending on calculated age you can set the selectlist value like this:
ff_getElementByName('selectlistname').value = "wanted value";

3) Sending email to the "emailescola" element can be easily set. Just go to the Advanced properties of that element and check the "Mailback" checkbox. That will do the trick.

Regards,

Mihaela
#232499
Attachments:
  • mlangamer
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 24
  • Thank you received: 0

mlangamer replied the topic: mysql database query in element (select from list)

O Elemento (emailescola) é um hidden input porque eu não gostaria de mostrar o e-mail da escola e este tipo de Elemento não tem a opção de "Mailback". Você tem alguma sugestão?
#232533
  • mlangamer
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 24
  • Thank you received: 0

mlangamer replied the topic: mysql database query in element (select from list)

The Element (emailescola) is a hidden input because I would not like to show the email from the school and this type of Element does not have the option of "Mailback". Do you have any suggestion?
#232534
  • Posts: 1465
  • Karma: 48
  • Thank you received: 194

mihaela replied the topic: mysql database query in element (select from list)

Hello,

In your case I wouldn't suggest that you check for unique email address entered in emailescola because if I understood correctly that field wouldn't have the student's email address, but the address of someone related to the school.

You need to check for a field specific for a student. Maybe name or you could add field in form where student would enter his email.
What his will do is it will check whether a record with that entered value is already present in database and if it is it won't allow user to submit the form.

I hope that you understand what I'm trying to explain.

Regards,

Mihaela
#232545
  • mlangamer
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 24
  • Thank you received: 0

mlangamer replied the topic: mysql database query in element (select from list) - item 3

Sorry but I do not think I expressed it well.
It refers to item 3 where you mention:
3) Sending email to the "emailescola" element can be easily set. Just go to the Advanced properties of that element and check the "Mailback" checkbox. That will do the trick.
I need the school to also receive a copy of the form with the pre-enrollment form. but the field in the form that has the e-mail address is a hidden field. and you do not have the option to mark "Mailback" in your properties / advanced. how can I proceed?
#232547
  • Posts: 1465
  • Karma: 48
  • Thank you received: 194

mihaela replied the topic: mysql database query in element (select from list) - item 3

Hello again,

Oh, I understand now what you meant.

There is a solution to this. Instead of Hidden input element, create a regular Textfield element "emailescola".
Then you can hide this element as follows. Go to Advanced properties of that textfield and check the Turn off checkbox.
That will have the same effect as if you have used the Hidden input element type, but the difference is that textfield's have Mailback option available.

Check the checkbox as explained and that will do the trick.

Let me know if that is what you wanted and whether it works for you.

Regards,

Mihaela
#232552
Moderators: ForumSupporttomeperica
Time to create page: 0.085 seconds

New Support System

Dear Customers,

Users with active subscription have support priority which will be dona via ServiceDesk (My Account > Raise a ticket).
FREE Support topics will be answered when AND if there is time.

You can check support guidelines here : here

Regards,
Crosstec Team

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here