TOPIC:

Checkbox nur anwählbar, wenn Datum in Zukunft 1 year 10 months ago #261872

  • Topic Author
  • Mehmet
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 13
  • Thanks: 0
Hallo Leute,

hab da ein Problem, ich möchte ein Checkbox einrichten, die nur an klick bar ist wenn das Datum in Zukunft liegt, also Morgen zum Beispiel.
Hat da jemand eine Idee.

Gruß
Mehmet

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

Checkbox nur anwählbar, wenn Datum in Zukunft 1 year 10 months ago #261896

  • Mirec's Avatar
  • Mirec
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 3262
  • Thanks: 163
Hi,

I hope that we can continue with England language! :)

I do not understand the well question, could you please explain it a little better and I will help you!

As I understand I make one example of how should look it.
Please download->unzip->and install it (BF->Configuration->Package Installer->select this xml file->Install Package).

In Advenced of Form->Scripts->Init script you can find code this:
function ff_mirko0000_init()
{

setInterval('test()', 500);

} // ff_QuickForm972683687_init

function test(){
var f =ff_getElementByName('b').value;
var h =ff_getElementByName('c').value;

if(f > h){
jQuery(document).ready(function(){

jQuery("#ff_elem6335").attr("disabled", true);
});


}
else{
jQuery("#ff_elem6335").attr("disabled", false);

}
}
In field Current date in propertis i section value I added current dates.
<?php return date('Y-m-d');?>


Explanation of code:

1)function ff_mirko0000_init()
instead 'mirko0000' insert name of your form.

2)jQuery("#ff_elem6335").attr("disabled", true); instead 'ff_elem6335' you need add id of checkbox, you need make inspect in console and find 'id' of checkbox.(not id lable of checkbox then id of checkbox)


An example you have three fields, one Checkbox and Current Date which is a hidden field (In Advanced of element I turn off element that you can not see the element in frontend), and Calendar, if you select in the calendar above the date of the current you will not check the box otherwise you can do it.

Please test it and let me know the result!
If you get stuck, let me know!

Regards,
Mirko
Attachments:

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

Last edit: Post by Mirec.

Checkbox nur anwählbar, wenn Datum in Zukunft 1 year 10 months ago #261909

  • Topic Author
  • Mehmet
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 13
  • Thanks: 0
Hello Mirko,
I'll try an English translation.
I have a homepage: Wochenplan (mensa-whgneuwied.de)
with a form.
if you click on the checkbox e.g. Monday, further input fields appear to be filled out.
But I would like the checkbox: Monday only to Sunday 4:00 p.m. to be clickable, otherwise it is deactivated.
Checkbox: Tuesday, then only until Monday 4 p.m. and so on.

Another question:
I also found a date validation YYYY-MM-DD in the forum, but I want one with DD-MM-YYYY, how do I do that.
Greetings from Neuwied, Germany
Mehmet

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

Checkbox nur anwählbar, wenn Datum in Zukunft 1 year 10 months ago #261913

  • Mirec's Avatar
  • Mirec
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 3262
  • Thanks: 163
Hi,

But I would like the checkbox: Monday only to Sunday 4:00 p.m. to be clickable, otherwise, it is deactivated.
Checkbox: Tuesday, then only until Monday 4 p.m. and so on.


Ok, I figure out what you want and I made one example of how it should work and I sent an example in the attached file, Please download->unzip->and install it (BF->Configuration->Package Installer->select this xml file->Install Package).



You can find code in Scripts->Init script :
function ff_mirko0000_init()
{

setInterval('test()', 500);

} // ff_QuickForm972683687_init

function test(){
var selecteddate =ff_getElementByName('b').value;
var currentdate=ff_getElementByName('c').value;
var time =ff_getElementByName('d').value;

if(time > 16 ){
jQuery("#ff_elem6335").attr("disabled", true);
}
else{
jQuery("#ff_elem6335").attr("disabled", false);
if(selecteddate  > currentdate){
jQuery("#ff_elem6335").attr("disabled", true);
}else{
jQuery("#ff_elem6335").attr("disabled", false);
}

}

}

- jQuery("#ff_elem6335").attr("disabled", true); instead 'ff_elem6335' you need add id of checkbox, you need make inspect in console and find 'id' of checkbox.(not id lable of checkbox then id of checkbox)

In my example, I added yet one element that fetching current time, you can find code in properties of the element in section 'value'.

When you select a date in the element calendar (not longer than 7 days) and current time, not after 16h, you can enable the checkbox otherwise you can not do it.

I also found a date validation YYYY-MM-DD in the forum, but I want one with DD-MM-YYYY, how do I do that.

you can do it, GO in properties of your element, and find field 'format' and insert this format
"%d-%m-%Y "

I hope I explained a well!
If you get stuck, let me know!
Regards,
Mirko
Attachments:

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

Last edit: Post by Mirec.

Checkbox nur anwählbar, wenn Datum in Zukunft 1 year 10 months ago #261948

  • Topic Author
  • Mehmet
  • Offline
  • New Member
  • New Member
  • Registered
  • Posts: 13
  • Thanks: 0
Hi Mirko,

unfortunately your link does not work
greeting
Mehmet

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

Checkbox nur anwählbar, wenn Datum in Zukunft 1 year 10 months ago #261951

  • Mirec's Avatar
  • Mirec
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 3262
  • Thanks: 163
Hi,

did you find the 'id' of the checkbox as is described in the above comment?
I just tested it on my server and everything works well.

Regards,
Mirko

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

Time to create page: 0.056 seconds

Support Chat

Join our Discord chat and enter the Crosstec channels for live-support, chat forums and interact directly with the community!

After joining, please enter the Crosstec Area and use the #crosstec-support or #crosstec-general channels.

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

Subscribe to news and updates!

Special Offer

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!

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!