Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
One of my customer who is using Umbraco Forms to register bookings to travels has an enquiery of development.
On some travels they have a limited amount of rooms, ie, single room double room and so on.
Now they want to be able to count down the available rooms when a user registrate so that there are less room available.
I can easily create this functionality on a custom form but we have integrated Umbraco forms heavily in the solution and want to continue to do that in this project too.
Does someone else encountered this and have workable solution?
The only way I can think of doing this would be a custom workflow, or a special "thank you" page.
I would probably say the page way is safer so you can show the end user if they were to slow in filling out the form if it's down to the last spot.
On submit, the "thank you" page has TempData stored so you can get the form information from that.
Hope this helps
I think you'd need to approach this from multiple angles.
1) On the page where you render your form it would be worth checking if there is availability at that point in time, if there is render the form, if there isn't hide it.
2) You could create a custom form question type to override one of the normal questions, such as number of rooms, for example. Then as part of the validation of this question you could check the room availability. If there is insufficient rooms available you can simply invalidate the entry and show the appropriate message.
These two steps should combine to create a reasonably robust validation approach.
Thank you for your great input!
If Im going to use your solution Nik, how can I check if there are enough rooms available?
I suppose I need to check all entries in the db like this on the page:
(thank you Matthew)
DynamicRecordList GetRecordsFromForm(string formId)
and then iterate all recordfields:
Dictionary<Guid, RecordField> RecordFields
and look for my record and if its true then check my static number of available rooms.
I think a combination of your two answers seems like a good approach!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted