Limit to number of conditional fields

  • Profile Image
    cflights
    Asked on October 16, 2012 at 02:43 PM

    Hi, nice product. I am trying out before making a purchase.

    I have a form at http://form.jotformeu.com/form/22833432051343 and I am adding condition fields depending on the number of tickets booked i.e 1 ticket booked only shows boxes for 1 person to enter details...2 tickets booked then boxes for 2 people to enter details etc.

    However as I continue to add the conditions to show / hide the fields then the display does not appear to be correct.

    Is there a maximum number of conditions that can be used ?

    I am using the IF field = value then show Field x

    If you can take a look at the form perhaps you will get an idea and may be able to tell me the best way to acheive the results I need.

    Many thanks in advance

    Andrew

  • Profile Image
    Mike_T
    Answered on October 16, 2012 at 05:23 PM

    Thank you for contacting us.

    Unfortunately, separate conditions will conflict with each other. To achieve your goal I would like to recommend you to combine your conditions.

    For example, use only one condition to show 'Passenger 1' field, one for 'Passenger 2' field, and so on. The downside of this method is the number of rules you will need to add. Also, as you use two payment methods on your form rules are multiplied by 2.

    Here is an example of showing conditional 'Passenger 1' field in three cases for two payment methods.

    I have made conditions for three options Solo special, 2 person special and 3 person special.

    http://form.jotformpro.com/form/22896841851970

    You can clone mentioned above form to check the back end.

    So for 10 optional persons you will need to add 20 rules to show 'Passenger 1' condition, 18 rules to show  'Passenger 2' condition, 16 rules to show 'Passenger 3' condition and so forth.

    If you need any further assistance, please let us know.

  • Profile Image
    cflights
    Answered on October 16, 2012 at 05:58 PM

    Hey Mike_T,

    Thanks for that guidance much appreciated...I did not realise that it was possible to combine various conditions into one, now I know this I will use the conditions you set up and follow that example.

    Really appreciate your help, great support.

    Thanks again
    Andrew

  • Profile Image
    Mike_T
    Answered on October 16, 2012 at 06:01 PM

    You are quite welcome, Andrew.

    Please feel free to contact us anytime. We would be happy to help!

  • Profile Image
    cflights
    Answered on October 17, 2012 at 07:14 PM

    Hi,

    I do have another question now :-)

    I have just included the source code into a Joomla page (I have used joomla for many years) but the form does not display or work as expected.

    The page is at http://www.champagne-flights.co.uk/index.php/make-a-booking I don't think the is a code clahing issue but I may be wrong. Also all the UK Pound signs £ were not recognised and wre subsituted.

    Any ideas appreciated.

    Many thanks
    Andrew

  • Profile Image
    idarktech
    Answered on October 17, 2012 at 07:43 PM

    Hi Andrew,

    This article may help you about adding form to Joomla. http://www.jotform.com/help/6-Adding-Form-to-Joomla. Check the bottom part of this article for some tips and plugin that may help fixed this code conflict problem.

    Thanks!

  • Profile Image
    cflights
    Answered on October 18, 2012 at 04:05 AM

    Hello Idarktech,

    Thanks for that response, however...

    I am already using Jumi to inset the code into the page as I have found this the most reliable for Joomla.

    Any other thoughts.?

    Thanks

    Andrew

  • Profile Image
    idarktech
    Answered on October 18, 2012 at 06:14 AM

    Andrew,

    If you are using Joomla 1.6, my colleague's trick may help. It's editing your filter file to recognize javascript codes. http://www.jotform.com/answers/24068-Does-Joomla-1-6-not-support-JotForm-forms#29702

    Also, did you try using default script embed code instead of source code? If not, please give it a try, that might help. Furthermore, be sure to place your script embed code on HTML area not on Visual mode or else it wont work.

    Please update us the progress on this. Thanks!

  • Profile Image
    idarktech
    Answered on October 18, 2012 at 06:56 AM

    Ok, I have tested it with script embed code and it seems to be working fine. Example:

    http://idarktech.com/joomla16/index.php/form

  • Profile Image
    cflights
    Answered on October 18, 2012 at 05:27 PM

    Hi  idarktech,

    Thanks for looking into this...I have an update for you...

    I am using Joomla 2.5.x and the Jumi plug-in.

    If I paste just the link to the form into the page everything is fine. However this is not a solution for me as I need to edit the HTML form code when it is on the page to incorporate a couple of functions not directly supported by JotForm.

    If I copy the source code for the whole form and inject this into my Joomla page using Jumi then the page is corrupt. This would indicate that when the form code is called onto a page by using a link to the form there is some other code or wrapper included that is not included when the source code is copied...if it works for just using the link to the form it should work if the code is pasted into the page if they are both the same format. It would appear they are not.

    For reference I am now working on the Clone copy of the form as had to make some Paypal changes.

    Also as an aside I have not received any notification emails even though this seems to be set up correctly.

    Thanks in advance for your help

    Andrew

  • Profile Image
    cflights
    Answered on October 18, 2012 at 05:30 PM
  • Profile Image
    fxr
    Answered on October 18, 2012 at 06:34 PM

    You are embedding the entire forms source code. 

    Try adding the form with just the single line script embed code. 

    --

    It will look a bit like this:

    <script type="text/javascript" src="//form.jotformpro.com/jsform/XXXXXXXX"></script>

    --

    Its option 2 in this guide:

    http://www.jotform.com/help/67-Which-Form-Embed-Code-Should-I-Use

  • Profile Image
    idarktech
    Answered on October 18, 2012 at 07:06 PM

    @cflights

    It seems like the javascript for conditions is being stripped. I'm not quite sure if this helps but worth a try. 

    Ok, try to compile the conditions script into a single js file. To do that, just copy the condition script to notepad, remove the script tags and then save it as javascript file (.js extension). Next is to upload the js file (example jotformcondition.js) to your server then declare the script back to your source code using the following code.

    <script src="http://www.yourwebsite.com/yourjspath.js" type="text/javascript"></script>

    Just replace the link to your JS correct path. You can also view the condition's script here: http://idarktech.com/test/jotformcondition.js

    So your embed source code should look like this:

     

    Let us know if this doesn't work so we can assist you further with this.

    Thanks!

  • Profile Image
    idarktech
    Answered on October 18, 2012 at 07:21 PM

    Ok before doing that, please review your embed codes because I noticed that your conditions script was cut or the end part was removed? Maybe you've accidentally deleted it after adding your custom script. Please check this screen. I'd suggest to retake again your source code and compare it with this. Thanks!

  • Profile Image
    cflights
    Answered on October 22, 2012 at 03:28 PM

    Hi all,

    I have now spent a bit of time on this and have the following...

    1. The code I was injecting onto the Joomla page did containe all the form HTML and Javascript but for some reason Joomla was cutting some of the JotForm script. I therefore used the solution to include the form logic as a separate file and that worked fine.

    2. I do however have an issue with the basic form in that if I apply 2 conditions which have the correct logic it throws out the other logic for that section of the form. Is there a limit to the number of logic functions taht can be applied. I am now using the cloned version of the form and the 2 conditional statements are the very last 2 on th elist, remove these and the other logic for that section does what it should add these 2 conditions back in and the logic dosn't work.

    Any ideas on this new issue.

    Thanks
    Andrew

  • Profile Image
    Rodjit
    Answered on October 22, 2012 at 06:55 PM

    Hi Andrew,

    Two (2) conditional logic to one field won't work. Only Rule can be added to each condition applied.
    Thanks and let us know for questions.
  • Profile Image
    cflights
    Answered on October 23, 2012 at 08:12 AM

    Hi,

    I do not have 2 conditions applied to the same field...I have the field set to display if 'any' of the conditions noted apply.

    I have checked to logic and it is correct...therefore I still have the issue.

    Thanks
    Andrew

     

  • Profile Image
    EduardoMendez
    Answered on October 23, 2012 at 10:13 AM

    Hello Andrew,

    If I understand correctly, your conditions (mostly) work fine when testiing the stand alone form but the issue comes once you embed the form.

    Have you tried embeding the form with the iFrame code?

    It sometimes helps as it avoids conflicts between scripts in a page.

    As per the conditions on the form, they seem to be working fine so far.  It looks like you need to add more conditions in order to Show Hide the other number of passangers.

    I will continue to look at your form and please advise if I am missing something.  I'll be glad to continue troubleshooting for you.

  • Profile Image
    cflights
    Answered on October 23, 2012 at 11:01 AM

    Hello EduardoMendez,

    Thanks for helping with this issue.

    If you take a look at the cloned version of the form which is the current version...look at it in preview mode and make a selection of varios flight packages you will note that all you see are the fields for 1 passenger not the number selected.

    Now...go to the conditions and deleted the last 2 that are relative to passenger 10 (it is fine for you to do this)...now go back to preview mode and select the different passenger options and this time you will see they work...so the overall operation has something to do with the last 2 conditions and I cannot understand why.

    Hope this helps.

    Thanks
    Andrew 

  • Profile Image
    idarktech
    Answered on October 23, 2012 at 11:19 AM

    Andrew,

    Append this CSS codes to your form. This might help.

    .form-line{ display:block; }

    Follow this guide: How to Inject Custom CSS Codes

    Thanks!

  • Profile Image
    idarktech
    Answered on October 23, 2012 at 11:27 AM

    Yes, the code above fixes it as seen here: http://form.jotformpro.com/form/22964103762958? (cloned form of yours)

    Thanks!

  • Profile Image
    cflights
    Answered on October 23, 2012 at 11:36 AM

    Hi idarktech,

    Great that worked...

    Could you please help me understand why that worked as CSS and conditionas are not connected ?

    Thanks again to all who helped.

    Andrew

  • Profile Image
    idarktech
    Answered on October 23, 2012 at 12:41 PM

    Andrew,

    That is an issue on how webkit browsers (Chrome & Safari) handles the css display property display:inline-block; in short this is an issue with these browsers rather than a JotForm Bug.

    Your form condition actually works with Firefox even without that codes. But, to make it more cross browser compatible you have to apply that code.

    Thanks!