Code

Discussion on Smart Forms

Discussion on Smart Forms

Cart 4,302 sales

elflaire supports this item

Supported

654 comments found.

Hi, I’m trying to set up a combobox that has a conditional logic.

ie) Country field is a combobox and when a user selects Canada, Province drop down is displayed. When a user selects US, State drop down is displayed.

I tried to use both combobox and conditional logic in one field but it doesn’t seem to work. http://doptiq.com/smart-forms/demos/samples/elegant/combobox.html http://doptiq.com/smart-forms/demos/samples/elegant/conditional.html

Can you please help me what I should do to make this work? Thanks.

These are two approaches

The combo uses a normal select and jQuery UI has a select method which you can run to show and hide the province selects

You can either do this

$("#country").combobox({ 
    select: function (event, ui) {
        if($(this).val() == 'Canada'){ 
            //Your code for showing the Canada provinces
        } else if($(this).val() == 'US') {
            //Your code for showing the US provinces
        } else {
            //Hide both province selects    
        }
    } 
});
Or this

Or this

$("#country").combobox({ 
    select: function (event, ui) {
        if(this.value == 'Canada'){
            //Your code for showing the Canada provinces
        } else if(this.value == 'US') {
            //Your code for showing the US provinces
        } else {
            //Hide both province selects    
        }
    } 
});

Please make sure your option value matches Canada and US respectively (case sensitive)

And note that this does not require the conditional logic plugin

Hi, this works only if a user uses Country dropdown menu and select a country from the list. If a user just types “Canada” in the Country combobox instead of selecting “Canada” from the list, it doesn’t trigger the Canada provinces. How should I cover that case?

You can use other approaches to this such as keyup, paste etc on the input field its self so that if the user inputs anything you triger the change – though this is a tricky scenario

Have a quick question, could you please help me display the client IP address on the email your form generates and also have it post it on the csv file? If it can also put a date/time stamp that would be great. I know I have to place $_SERVER[‘REMOTE_ADDR’] somewhere but I dont know enough of PHP.

As always, thanks for your anticipated awesome support.

For anybody that reads this post, please know ELFLAIRE has always given great support. 5 stars service.

Once again I have to say. Great Job! Just a quick question, I have added about 20 extra fields but when I’m on the admin page looking over the details I can not see the extra fields. The information is posting like its supposed to, I just can scroll to the right to view the other columns. I know in mobile all the information will be there if I press the plus button but when I’m on my desktop and cuts it off. Any suggestions will be greatly appreciated

Did you add the fields to the CSV list? That could be the problem

Thanks for your always quick reply. Yes the form is working exactly as advertised. The csv list has been updated. I think its just a bug that when I login to the admin page to view the results on the online database, you can not scroll to the right if you add extra columns. http://mytnpr.com/survey/images/admin.jpg As you can see from the image, all the data is coming in but after the satisfaction column I have about another 15 columns that on a desktop environment do not appear. Once again, great job on all the updates.

Five star support.

OK let me look at the admin css

Hi

We recently purchased your package. We wondering if you would be updating your jquery 1.11+?

Thanks, Johnny

Hi Johnny,

The package should work fine with that version – have you found any bugs in regards to that version?

The reason i left 1.9 was for support of IE8, but it should be updated soon

Thanks

Hey,

I am wanting to implement your checkbox styles into my Logo Inspiration Generator Tool built in Gravity Forms (http://www.courtrightdesign.com/logo-design-inspiration-generator-tool/).

What is your suggestion on the best method to make this happen?

Ok let me work out something in that direction

Thanks so much

Anytime

Hi again Elflaire

I would like some advise regarding the use of a dynamic session variable within your javascript.

I have created the variable and tested that it is working by calling an alert… this is working fine.

The variable has been set within the javascript just after the function like so:

$(function() { var mysession = "<% = session("MYSESSION") %>";

I need to use this numeric session value as the min numeric value for a textfield.

This is the rule for the text field:

theoffer: { required: "#specialofferyes:checked", min: mysession },

However, if I enter a value less than the known session variable value into ‘theoffer’ text field and submit the form the field is not being validated correctly. IN other words it is not recognising that the value entered into the field is less than the session value.

Could you help with this at all?

Here is an example

We have a field which will hold our value – if you were using php you would have to echo the session value but since i am not well convesant with ASP i guess you know how to go about it – alerantively we generate that value and set it via jquery / javascrip

So here is the field that will hold our value – we shall set this field off screen with css – please dont hide it with display:none

<input type="text" name="valuefield" id="valuefield">

Next we shall – set our value via JS this is a simple example

$('#valuefield').val("4");

Please note that i have set the value manually but for your case set it via session value – i mean something like this

var mysession = "<% = session("MYSESSION") %>";
$('#valuefield').val(mysession);

Next we have our field that will be filled – for thesting our value

 <input type="text" name="theoffer" id="theoffer"> 

The validation rules

valuefield:{
    required: true,
    number: true                    
},
theoffer:{
    required: true,
    number: true,
    min: function () { 
        return $('#valuefield').val(); 
    }                                        
}

The validation messages

valuefield:{
    required: 'Please something',
    number: 'Please numbers only'                    
},
theoffer:{
    required: 'Please something',
    number: 'Please numbers only',
    min: 'Must be higher value'                                
}

Obviously you do not have to validate – valuefield – since its already pre-filled by default

Now i noticed another problem with our method – if someone types something like 11 – it validates as invalid since it considers single digit values only – 0-9 so we have to look into this

Hi Elflaire

Thanks for your help with this. Much appreciated.

Always happy to offer some assistance

hi elflaire, nice extension, working perfect and flexible. I just don’t seem to be able to change the currency from dollar to €, the slider and amount keeps failing after trying to change several settings for the mailer quote form. Can you help me out?

Hello

Using the actual euro symbol (€) may get rejected or result into a funny character with javascript

So the solution is to use the unicode value for the euro symbol

So change this

To this

\u20AC

That should work Thanks

Thanks wasn’t aware of those currency unicodes. Just a question, you have an admin panel included, is there a default login or perhaps a guide on how to make this work?

Hi Aristotle25,

The admin details are included in the documentation as well as the default login details and creating new passwords – please note that it uses salted passwords so you have to hash the password first

Thanks

Hey how can I disable certain day in a week on the calendar ? We will be closed for Tuesdays of all months. How can I disable it ?

Okay I copied and pasted the last entire code. And it’s working. You are a genius. So I can add as many dates as I want ?

Many thanks. You’re a guru.

Thanks for the compliment and yes you can add as many dates as you want

I just bought it. But it requires code copy and paste, and have to understand the codes. It’s not a drop and done style. It’s hard for me to use. Can I get a refund? Thanks.

Hi Sanvinna,

Please contact envato support for the refund

Thank you

Hello, I got this error,

Warning: escapeshellcmd() has been disabled for security reasons in /home/llartcom/public_html/formularios/php/phpmailer/class.phpmailer.php on line 1142

Can you help me please ?
Thx a lot

Hi Mr-frontflip,

That is a server error for your shell script – please talk to your host to resolve the error

Hello, I’m looking for a way to add a “Check All” and “Clear” option for checkboxes. I went through the examples, but didn’t see anything like that. Did I perhaps miss it? Any help would be appreciated! =]

Hi Pbm001,

This feature is not included

The simple answer is this

The HTML

You have a checkbox to toggle (check and uncheck) all others

<label><input type="checkbox" id="checkAll"/> Check all</label>

You have a group of checkboxes to be toggled (checked and unchecked)

<div id="checkbox-group">
    <p><label><input type="checkbox" /> Option 1</label></p>
    <p><label><input type="checkbox" /> Option 2</label></p>
    <p><label><input type="checkbox" /> Option 3</label></p>
    <p><label><input type="checkbox" /> Option 4</label></p>
</div>

The JQUERY

$("#checkAll").change(function () {
    $("#checkbox-group input:checkbox").prop('checked', $(this).prop("checked"));
});

Hello, I’m using your Combobox widget, but I can’t make the validation work for this element, while the other form elements are validating correctly.

I didn’t find a specific example of this in your documentation, can you please help me?

Thanks

Hello again, just found instructions regarding INPUT CUSTOM NAME and INPUT CUSTOM ID, which solved my problem.

Thanks anyway

Thanks Luigi,

I included that part to simplify the validation process of the combo

Does this support ContentEditable elements, or can it be made to do so? The purpose being so you can put links etc into the “textarea”

I believe you can add HTML elements into the text area Thanks

Does branching work with multipane? That is, can you trigger a pane change with branching? Also, is there any documentation for branching? Thank you.

Which component (multipane) is that?

Hello,

Is it possible to use the HTML <datalist> Tag ? I need an option to select a couple of pre-defined values but to also have the possibility to specify one myself. If yes, can you give me an example?

Thank you.

Nevermind, I found the answer here: http://www.w3schools.com/tags/tag_datalist.asp

Hi elflaire,

I am trying to use your combobox.

But i want to restrict value entered by user in the combobox to the select options available.

If value entered by user is not found in the combobox then the user should get an error message that no value found and should not be allowed to enter any other value.

Pls help me in how to do using combobox.

Regards, Amish

Hi Amish,

I haven’t tried your approach with a combo being that combos allow both selection and input.

Let me try it and see if its possible

Hello

I have a form with two calendars.

I was wondering how to use a date range where selecting Date 1 disables all dates before Date 1 ?

Hi Elflaire, have you had chance to create an example for me to see please?

My apologies

THE HTML CHANGES

First of all you need to make this change to your HTML

Just below the input fields change this line below

<label class="field-icon"><i class="fa fa-calendar" /></label>

To this – you will notice that you forgot to close the icon tag properly above

<span class="field-icon"><i class="fa fa-calendar" /></span>

THE JAVASCRIPT CHANGES

Date Picker 1 JS #coursedate

$("#coursedate").datepicker({
    numberOfMonths: 1,
    prevText: '<i class="fa fa-chevron-left" />',
    nextText: '<i class="fa fa-chevron-right" />',            
    showButtonPanel: false,
    dateFormat: 'dd-mm-yy',
    onClose: function( selectedDate ) {
        $("#theenddate").datepicker( "option", "minDate", selectedDate );
    }                    
});

Date Picker 2 JS #theenddate

$("#theenddate").datepicker({
    numberOfMonths: 1,
    prevText: '<i class="fa fa-chevron-left" />',
    nextText: '<i class="fa fa-chevron-right" />',            
    showButtonPanel: false,
    dateFormat: 'dd-mm-yy',
    onClose: function( selectedDate ) {
        $("#coursedate").datepicker( "option", "maxDate", selectedDate );
    }                    
});

The rest stays as it is

Thanks

Awesome! The amended Java has fixed the issue. Thank you so much for your time. Much appreciated : )

Hi there

I need to close the modal pop-up but cannot find a close button feature on the example pages.

So I have followed suggestions above but cannot get the close button to work.

Any ideas would be appreciated:

Java: $(function() { $(‘[data-smartmodal-close]’).on(‘click’, function(e) { e.preventDefault(); var smartInactiveModal = $(this).attr(‘data-smartmodal-close’); $(smartInactiveModal).removeClass(‘smartforms-modal-visible’); $(‘body’).removeClass(‘smartforms-modal-scroll’); }); });

HTML: <button type=”reset” data-smartmodal-close=”smart-modal1” class=”button”> Close </button>

HI again… sorry for my message. I now have the close button working fine : )

I am having the same issue as a few others in the comments where when I click the submit button nothing happens and I can see it looks like its pointing to #Finish. I am expecting my form to post to a PHP page to handle the data. Has anyone managed to figure out what is going on here?

Hi Azler,

Inside the PHP folder there is an example of posting with multi steps its a little different from the normal post since you post through the finish function of the multisteps plugin

Please look Here for a working ajax multistep demo

And here is the the way the js file is setup – demo js file setup

Now look at this section – named onFinished: function looks like this below

onFinished: function (event, currentIndex){
    var form = $(this);
    $(form).ajaxSubmit({
            target:'.result',               
            beforeSubmit:function(){ 
            },
            error:function(){
            },
             success:function(){
                    $('.alert-success').show().delay(7000).fadeOut();
                    $('.field').removeClass("state-error, state-success");
                    if( $('.alert-error').length == 0){
                        $('#smart-form').resetForm();
                        reloadCaptcha();
                    }
             }
      });                    
}

Now if you look at that onFinished: function – all the sajax submit stuff is done inside there – thats all the difference with the non-multi step versions

Now also notice that – the order of script initialization is:

1 – initialize – multisteps (including ajax submit)
2 – add the validate – just below multisteps
3 – lastly initialize other plugins

For more clarity – In the documentation i included an example with all the possible methods – just look at the ajax php section and find an area named – Steps Events, Methods, Validation

Thanks

The trouble is I am not trying to send a mail from at the end of the form. I want the data to be posted to another PHP page where I can manipulate it separately away from the form. The form is simply used to capture the data in the first place.

Is there any way I can modify the function to act as it normally would by posting the data to the post page instead of trying to execute it within the same one?

I have noticed that if you hit enter on the last form it does actually try and post it to the page I specified. Its just the last button generated by the wizard does not submit the data.

Sorry I appreciate if this was not built to function like this but I will need it to act in this way to meet the requirements of what I am trying to do.

Rob

Hi Azler,

How are you trying to handle your post function? Plain post or ajax post?

Hello I try to realise substeps inside of a Multistep form. Is this possible to have like two steps bevor going to the next step in the navigation view above?

Hi Mueller,

You mean sub steps inside the main step?

exactly! sub steps inside a main step! thanks!

Send me an email on my profile as i work around that to see how we can add these

Thanks

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey