I
have stumbled into an issue which I find very strange and not sure
why it is happening. If I set the FormStep via jQuery and click the
Next button all seems to work fine except that the values are not
actually stored when I submit the form or re-open it for that matter,
the same happens with the Previous button. If I click Next/Previous
without setting the FormStep via jQuery then it saves the values fine.
Do you have any idea why this might be happening?? For your reference
this is the code I am running in a customised Form.cshtml specific to
the form in question:
I have attached some
screenshots to show the difference between when the FormStep is set via
jQuery and when it is set as normal. As you can see, another issue is
that the validation is hit as soon as the form step appears when the
step has been set via jquery as opposed to that not happening when the
form step is left as normal. For your reference the PreviousFormStep and
NextPageNumber are custom fieldtypes I have created to be able to
specify which page should be shown on the next and previous button
clicks as per the code above.
Thanks Tim, I really want to use Contour for this project as it allows the admin users a convenient way of updating the forms using a method they are already familiar with, plus I would just like to prove that Contour could be used for a project such as this as I would then use again for similar in the future. I don't mind if it is a bit of a hack so long as I can find a way of making it work without having to resort to doing a bespoke build for the form functionality.
Ok I can reproduce the behaviour and I understand why this is happening, when you set a formstep it will validate and submit that step. Looking into the code if there is a easy and clean way of adding this functionality
I might add 2 hidden inputs prevstep and nextstep that you can then set in jquery and it will use those values to determine which page to go to , that doesn't mess with the formstep one that is used for validating and storing data
You are a star, if you can add this then that would be perfect and means I then know for sure I can do the full project using Contour as everything else I am trying works perfectly.
Thank you very much, just let me know the download link when you have a version available to test, for your reference the version I am using of Contour is 3.0.21 and running the site on Umbraco 6.0.5
I have just dropped the new version in and given it a quick test and setting the NextStep and PrevStep hidden fields via jQuery works perfectly. The validation is working as it should and form values are also being saved moving forwards and backwards as they should, you have been so helpful and thanks for the quick response and resolution.
Just a quick question, is there anyway of being able to return to a specific page number on a partially submitted form when accessing via the ?recordGuid url??
For your second question don't think there is atm but is easy enough to add (so you can also provide it with a query string param), so will do that and then get a new version out
As mentioned I have only had time to give it a quick test as currently working on another project today but will be able to test it more in full later this week, currently though everything looks to be working as it should. If you are able to add the option to return to a specific page that would be great so thanks in advance for that, that should then cover the majority of my outstanding requirements for my intelligent forms functionality.
Hi Tim, an additional question?? Is there anyway of knowing what the last page a user was on within the form so that you can return to that page upon re-opening the form?
Form Steps Issue
I have stumbled into an issue which I find very strange and not sure why it is happening. If I set the FormStep via jQuery and click the Next button all seems to work fine except that the values are not actually stored when I submit the form or re-open it for that matter, the same happens with the Previous button. If I click Next/Previous without setting the FormStep via jQuery then it saves the values fine.
Do you have any idea why this might be happening?? For your reference this is the code I am running in a customised Form.cshtml specific to the form in question:
I have attached some screenshots to show the difference between when the FormStep is set via jQuery and when it is set as normal. As you can see, another issue is that the validation is hit as soon as the form step appears when the step has been set via jquery as opposed to that not happening when the form step is left as normal. For your reference the PreviousFormStep and NextPageNumber are custom fieldtypes I have created to be able to specify which page should be shown on the next and previous button clicks as per the code above.
FORM STEP SET VIA JQUERY
FORM STEP NOT SET VIA JQUERY
Comment author was deleted
Thanks for these details will see if I can reproduce the behaviour, but since this is a bit of a hack I'm not quite sure we'll get it 100% working
Will keep you updated
Thanks Tim, I really want to use Contour for this project as it allows the admin users a convenient way of updating the forms using a method they are already familiar with, plus I would just like to prove that Contour could be used for a project such as this as I would then use again for similar in the future. I don't mind if it is a bit of a hack so long as I can find a way of making it work without having to resort to doing a bespoke build for the form functionality.
Comment author was deleted
Ok I can reproduce the behaviour and I understand why this is happening, when you set a formstep it will validate and submit that step. Looking into the code if there is a easy and clean way of adding this functionality
Comment author was deleted
I might add 2 hidden inputs prevstep and nextstep that you can then set in jquery and it will use those values to determine which page to go to , that doesn't mess with the formstep one that is used for validating and storing data
You are a star, if you can add this then that would be perfect and means I then know for sure I can do the full project using Contour as everything else I am trying works perfectly.
Comment author was deleted
Yup think that will work :) adding the bits now and will have something for you to test today/tomorrow
Cheers,
Tim
Thank you very much, just let me know the download link when you have a version available to test, for your reference the version I am using of Contour is 3.0.21 and running the site on Umbraco 6.0.5
Comment author was deleted
Ok got a WIP build for you, you can download it here http://nightly.umbraco.org/Umbraco%20Contour/3.0/UmbracoForms.files.3.0.23.WIP-Build.17.zip
To upgrade from your version follow the instructions here http://our.umbraco.org/projects/umbraco-pro/contour/documentation/Installation/Upgrade
Then you can set PrevStep and NextStep instead of FormStep
Comment author was deleted
let me know if that works
Thanks Tim, I will let you know as soon as I have had chance to give it a test :)
Comment author was deleted
Great :)
I have just dropped the new version in and given it a quick test and setting the NextStep and PrevStep hidden fields via jQuery works perfectly. The validation is working as it should and form values are also being saved moving forwards and backwards as they should, you have been so helpful and thanks for the quick response and resolution.
Just a quick question, is there anyway of being able to return to a specific page number on a partially submitted form when accessing via the ?recordGuid url??
Comment author was deleted
Great so it now functions as it should?
For your second question don't think there is atm but is easy enough to add (so you can also provide it with a query string param), so will do that and then get a new version out
Comment author was deleted
ow there actually is a way already, just provide ?formstep and it will load it on that specified form step
As mentioned I have only had time to give it a quick test as currently working on another project today but will be able to test it more in full later this week, currently though everything looks to be working as it should. If you are able to add the option to return to a specific page that would be great so thanks in advance for that, that should then cover the majority of my outstanding requirements for my intelligent forms functionality.
Oh excellent, even better, will give that a try :)
Hi Tim, an additional question?? Is there anyway of knowing what the last page a user was on within the form so that you can return to that page upon re-opening the form?
Comment author was deleted
Think you'll have to write a workflow for that , attach to partially submitted and store the form step against the member
is working on a reply...