TOPIC:

How to make an on/off with these characteristics? 1 month 2 days ago #258977

  • sciencemkt's Avatar Topic Author
  • sciencemkt
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Science applied to marketing
  • Posts: 233
  • Thanks: 0
Hello,
I am making a form where there must be a select with two options "DNI and NIE", when you select one of the two, you must open a box to write the number. If I select DNI, it opens the box for DNI 12345678-A (must be 8 numbers and a letter separated with a hyphen), if I select NIE, it opens the box for NIE X-1234567-A (must be an X, hyphen, 7 numbers and a letter separated with a hyphen).

How would you do this?

Thank you.
Alejandro Cobo
Neuromarketing Company

==============================================
Blog: www.alejandrocobo.com
==============================================
Facebook: @AlejandroCobo.Neuromarketing
==============================================
Instagram: @alejandrocobo
==============================================

Please Log in or Create an account to join the conversation.

How to make an on/off with these characteristics? 1 month 2 days ago #258978

  • sciencemkt's Avatar Topic Author
  • sciencemkt
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Science applied to marketing
  • Posts: 233
  • Thanks: 0
I have part of the answer to get the box according to the selection:

turn on element numdni if type_doc is DNI
turn off element numdni if type_doc is NIE
turn on element numnie if type_doc is NIE
turn off element numnie if type_doc is DNI

I have not been able to make that when I select DNI, it comes out 12345678-A (it must be 8 numbers and a letter separated by a hyphen).

NIE, I get X-1234567-A (must be an X, hyphen, 7 numbers and a letter separated by a hyphen).
Alejandro Cobo
Neuromarketing Company

==============================================
Blog: www.alejandrocobo.com
==============================================
Facebook: @AlejandroCobo.Neuromarketing
==============================================
Instagram: @alejandrocobo
==============================================

Please Log in or Create an account to join the conversation.

How to make an on/off with these characteristics? 1 month 18 hours ago #258992

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6086
  • Karma: 3
  • Thanks: 429
Hi,

I will create a small example for you, please give me some time

UPDATE:
here is a small example

File Attachment:

File Name: test175.zip
File Size:8 KB


Let me know if you need more help

Regards,
Tihana
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

How to make an on/off with these characteristics? 1 month 8 hours ago #259049

  • sciencemkt's Avatar Topic Author
  • sciencemkt
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Science applied to marketing
  • Posts: 233
  • Thanks: 0
Hi Tihana:
I have solved the case. I have performed a Turn on/off as follows:
turn on element numero_dni if tipo_documento is DNI
turn off element numero_dni if tipo_documento is NIE
turn on element numero_nie if tipo_documento is NIE
turn off element numero_nie if tipo_documento is DNI

Then, when selecting whether it is DNI or NIE, I have made a mask as follows:
echo '<script src="/includes/js/maskedinput/src/jquery.maskedinput.js" 
type="text/javascript"></script>';
echo '<script>
jQuery(function($){
     $("#ff_elem2055").mask("X-9999999-a");
     $("#ff_elem2046").mask("99999999-a");
});

It works perfectly. This has been with previous helpers that I have saved and have been useful for this.

Thank you very much for your work.
Alejandro Cobo
Neuromarketing Company

==============================================
Blog: www.alejandrocobo.com
==============================================
Facebook: @AlejandroCobo.Neuromarketing
==============================================
Instagram: @alejandrocobo
==============================================

Please Log in or Create an account to join the conversation.

How to make an on/off with these characteristics? 4 weeks 2 days ago #259058

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6086
  • Karma: 3
  • Thanks: 429
Hi,

super!
I am glad that masked input works ok for you :)

If you need anything else, feel free to ask

Regards,
Tihana
The following user(s) said Thank You: sciencemkt

Please Log in or Create an account to join the conversation.

How to make an on/off with these characteristics? 4 weeks 2 days ago #259078

  • sciencemkt's Avatar Topic Author
  • sciencemkt
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Science applied to marketing
  • Posts: 233
  • Thanks: 0
Thank you very much.
Alejandro Cobo
Neuromarketing Company

==============================================
Blog: www.alejandrocobo.com
==============================================
Facebook: @AlejandroCobo.Neuromarketing
==============================================
Instagram: @alejandrocobo
==============================================

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.051 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!