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.
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!
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
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
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!