Search through select list based on input in textfield

Here it is explained how to get your select list to show only options containing text which is entered in a long select list to make it easier to find the wanted option in the list.

To achieve so, go to your form's Advanced properties > More options > Scripts and in the Initialization script set Type to Custom.

In the code area below that appears, put the following code:

function ff_FORMNAME_init()
{

jQuery('[name="ff_nm_searchfiledname[]"]').keydown(function() {
    jQuery('[name="ff_nm_selectlistname[]"] option').prop('hidden', false);
    jQuery('[name="ff_nm_selectlistname[]"] option').not(jQuery('[name="ff_nm_selectlistname[]"] option:icontains('+ff_getElementByName('searchfiledname').value+')')).prop('hidden', true);

});


} // ff_FORMNAME_init

jQuery.expr[':'].icontains = function(a, i, m) {
  return jQuery(a).text().toUpperCase()
      .indexOf(m[3].toUpperCase()) >= 0;
};

 

 

NOTE: In the code above you have to replace FORMNAME with the Name of your form. Furthermore, replace every instance of "searchfieldname" with the textfield in your form and every instance of "selectlistname" with the Name of the select list which you wish to search through.

This search will be case insensitive and change in list will be applied as text is entered in the textfield.

 

Add a comment

ADDING CUSTOM STYLING ONLY TO A SPECIFIC FORM

Here it is explained how to add custom styling only to a specific BreezingForms form.

To achieve so, go to your form's Advanced properties > More options > Form pieces and in the Before Form set Type to Custom.

In the code area below that appears, put the following code:

echo '
<style>
// ADD CSS CODE HERE
</style>
'; 

Here are a few examples of adding the styling.

Example 1 - Enlarge the submit button:

echo '
<style>
#bfSubmitButton {
     float: none;
     width: 100% !important;
}
</style>
';

Example 2 - Enlarge checkboxes:

echo '
<style>
input[type=checkbox] {
  transform: scale(1.6);
}
</style>
';

 Example 3 - Put fields closer to labels:

echo '
<style>

.bfQuickMode .bfLabelLeft label {
      width: 30% !important;
}
</style>
';

 

 

Add a comment

DISABLE CERTAIN DAYS OF WEEK IN RESPONSIVE CALENDAR

BreezingForms

 

Here it is explained how to disable certain day(s) of the week in a Responsive Calendar, in other words, how to make it unclickable. Also, styling is added to the disabled day of the week so that users easier recognize that it can't be clicked on.

 

Go to Advanced options of your form > More options > Form pieces > Before Form, set Type to Custom and paste the following code:

echo '<script type="text/javascript">
		JQuery(document).ready(function () {
					
			JQuery("#ff_elem16229_calendarButton").pickadate({
				format: "yyyy-mm-dd", 
				selectYears: 60, 
				disable: [7],
				selectMonths: true,
				editable: true,
				firstDay: 1,
				onSet: function() {JQuery("#ff_elem16229").val(this.get("value"));}
			});
                    
		});
	</script>
<style>
.picker__day--disabled{
background-color: gray !important;
}
</style>
';

This is an example which will disable Sundays.

NOTE: You have to replace ff_elem5113_calendarButton with the ID of your calendar button. To find it you have to inspect that element. Also, replace ff_elem5113 with the right ID of the calendar field.

The part between <style> tags will make the disabled fields background gray. Here you can adjust CSS as you like.

Which days of the week are disabled is explained by the following:

disable: [6,7]

 

To disable the whole weekend, the following code should be added:

echo '<script type="text/javascript">
		JQuery(document).ready(function () {
					
			JQuery("#ff_elem16229_calendarButton").pickadate({
				format: "yyyy-mm-dd", 
				selectYears: 60, 
				disable: [6,7],
				selectMonths: true,
				editable: true,
				firstDay: 1,
				onSet: function() {JQuery("#ff_elem16229").val(this.get("value"));}
			});
                    
		});
	</script>
<style>
.picker__day--disabled{
background-color: gray !important;
}
</style>
';

 NOTE: Replace the ID as explained above.

 

 That will disable the wanted days which can be very useful, especially if the form is used for some kind of reservations or application.

 

Add a comment

CHECK IF EMAIL ALREADY ENTERED

BreezingForms

 

Here it is explained how to set Ajax validation for a field in a form so that if a user tries to submit the form with the same value which was already submitted in that form an error message is shown. 

In the following example, an email field NAMED "email" is being validated.

To implement this to your form, follow these steps:

1. Go to Properties of the field that you wish to validate. In the Validation section check the "Required" checkbox and set the Validation type to "Custom". In the code are below that appears, put the following code:

function ff_email_validation(element, message)
{
    if(ff_validemail(element, message) != '') return 'Please enter an email address';
    var myreturn = '';
    JQuery.ajaxSetup({async:false});
    JQuery.post('index.php', { option: 'com_breezingforms', ff_form: ff_processor.form, Itemid: 0, format: 'html', email: element.value }, function(data){ if( data != '1' ){ message == '' ? myreturn = 'Email exists already!' : myreturn = message; } } );
    return myreturn;
}

 NOTE: Replace every instance of email with the name of that field in your form that you wish to validate. Also, you can replace "Email exists already" with whatever message you want.

2. Go to the Advanced properties of the field that you wish to validate. In Actionscript section set Type to Custom and Action to Change. In the code below put the following code:

function ff_email_action(element, action)
{
    switch (action) {
        case 'change':
            JQuery('#bfEmailError').remove();
            if(element.value == '') return;
            var myreturn = '';
            JQuery.ajaxSetup({async:false});
            JQuery.post('index.php', { option: 'com_breezingforms', ff_form: ff_processor.form, Itemid: 0, format: 'html', email: element.value }, function(data){ if( data != '1' ){ myreturn = '<div class="bfError" id="bfEmailError"></div>'; } else { myreturn = ''; } } );
            if(myreturn != '') { JQuery(element).after(myreturn); } else { JQuery('#bfEmailError').remove(); }
            break;
        default:;
    } // switch
} // ff_email_action

 NOTE: Replace every instance of email with the name of that field in your form that you wish to validate.

3. Go to form's Advanced properties > More options > Form pieces and in the Before Form section set Type to Custom and in the code area below put the following code:

if( JRequest::getVar('email', null) !== null ){
   while (@ob_get_level() > 0) {
    @ob_end_clean();
   }
   $db = JFactory::getDBO();
   $db->setQuery("Select s.id From #__facileforms_records As r, #__facileforms_subrecords As s Where s.record = r.id And r.form = ".$this->form." And s.`value` = " . $db->Quote(JRequest::getVar('email', null)));
   if(trim($db->loadResult())){
     echo 0;
   } else {
     echo 1;
   }
   exit;
}

NOTE: Replace every instance of email with the name of that field in your form that you wish to validate.

4. Go to form's Advanced properties > More options > Submit pieces and in the Begin Submit section set Type to Custom and in the code area below put the following code:

$this->execPieceByName('ff_InitLib');
$db = JFactory::getDBO();
$db->setQuery("Select s.id From #__facileforms_records As r, #__facileforms_subrecords As s Where s.record = r.id And r.form = ".$this->form." And s.`value` = " . $db->Quote(ff_getSubmit('email')));
if(trim($db->loadResult())){
 exit;
}

NOTE: Replace email with the name of that field in your form that you wish to validate.

That will do the trick, your form will throw an error message saying "Email exists already" in case you try to submit the form with email address (or another info) that way already submitted.

 

To sum up, this is how to disable user to submit the form with the same value twice in a specific form field. You can apply this for email or username, or another field that you need. Above is explained how to apply this to a field in your form.

 

 

Add a comment

ADVANCED LIST FILTER ON MULTI-SELECT LIST

Here it is explained how to apply Advanced List Filter in Content Builder on a Select List element when the "Multiple" checkbox is checked so that more options can be select at a time.

If Advanced List Filter is applied on a multi-select list and Filter is defined as follows, it will only search for records where only one value was selected, for example only value1.

value1

value2

value3

It will not show records that have both values value1 and value3 and as selected values, or value1 and value2.

 

To see all records that include a certain value of a multi-select list, possibly along with some other value, define the Filter as listed below:

@match/value1

@match/value2

@match/value3

 After defining the filter this way, all records including the value searched for will be shown.

Add a comment

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!