What strategy should I use for multiple room booking selection without JS? - user-interface

The user requests 2 rooms on the initial page and is then presented with room types to select from on step 2. The arriving and starting dates will always be the same, but the number of adults and children may differ, causing the price to fluctuate.
Now, if JS is enabled I think I'll just program it such that it's tab-powered and when you hit 'Select' which is an input submit, it'll cancel the form submit and mimic a "add to cart" functionality, so the user must select at least one room for each specified.
I'm confused on how I should treat this with JS off - should I just enable radio buttons or checkboxes and have the user select with radio buttons per room? So instead of "Select" button image it would be just a label "Select this" text and a radio button nearby, and at the far bottom of my form there will be one primary submit button.

Ended up just not providing a non-JS alternative.

Related

Rails: disable input tag upon selection from a dropdown menu

Scenario/Context
I've got a drop down menu with two input elements underneath.
From the dropdown menu, are names of companies (with values set to the respective company id's), and another prompt to Add a new company.
If the option to Add a new company is selected from the dropdown, then the user is to fill out the 2 input field elements (i.e. company name and company email).
Otherwise, if an available company is selected from the dropdown,
then the 2 input fields (for company name and email are to be disabled).
My question
Is this possible to do without an AJAX call if I want things to happen without a page refresh?
Can anyone suggest some other alternatives??
Many thanks!
That is absolutely possible, though you'd need to use some JavaScript to make it happen and load a bit more data to the DOM on the initial page load.
For each option in your company select dropdown, add a data attribute for the name and email.
Then, watch that dropdown for the change event in JavaScript. Whenever that event is fired, if the data-company-name and data-company-email attributes are defined for the selected option, disable the input fields and populate them with those values. If those data attributes are not defined for the option (likely only for your 'Add a new company' option), then clear the values from the input fields and enable them.

Create an Apex form with multiple pages

I'm trying to make an apex form that has multiple 'pages' within it, so that I can achieve a nice layout.
For example:
Page 1 - Personal Details >> Page 2 - Occupation >> Page 3 - Career History >> Submit
Is there a way to do this without submitting one page at a time as this would mess up my validation for the table entry.
It's kind of a broad question - lots of possible solutions. You will need to create several regions on the page, so that you can easily show or hide different sets of page items without submitting the page.
If you simply want to keep the page tidy, you could make use of the Hide and Show Region template, or you could create a Region Display Selector region.
To help the user experience flow a bit better, I would probably do something like this:
Set up the page items using the Form wizard.
Create three HTML regions - Personal Details, Occupation, and Career History.
Move the page items into the appropriate regions.
Delete the original region created by the wizard, together with the default buttons.
Create navigation buttons in each region - probably a Next button in Personal Details, Next and Previous buttons in Occupation, and Previous and Submit in Career History.
Create dynamic actions for each of the buttons. The Submit button submits the page of course. The Next and Previous buttons show and hide the regions as appropriate.

How to design this page in razor world

In MVC-3/Razor, I need to create a page which will have five set of controls. Each set will have a drop-down and a text box. User will select an option from drop-down and then provide some feedback on text box.
When the view is shown very first time, I only have to enable controls in first set. Whereas all controls in 4 other sets should be disabled. Once user perform action in first set of controls (select optino from drop-down and enter in text box), the second set should become enable now, whereas other set of controls should still be disbaled. The data shown in this second drop-down is dependent upon what user has selected in first drop-down. Once user complete action in this second set, the data in third drop-down will depend upon whatever user selected in first and second drop-down etc.
I am a web-form aspx developer and not sure what will be the best way of designing this in MVC-razor world (because there is not view state etc).
Step 1)
What needs to be clarified is what will cause the other “sets” to be enabled?
Is it after the user has selected an item in the dropdown
OR
Is it after they have entered some text in the textbox?
What also needs to be clarified is if you have a dropdown AND a textbox are they both enabled at the same time or is the textbox only enabled after you’ve selected an item in the dropdown?
Once you’ve got that figured out, move on to the next step.
Step 2)
Do the users need to visually see the 4 sets from the beginning (disabling the 3 other sets) or can you simply show the other sets (on the fly) once the previous one has been successfully filled?
Depending on the answers, this may vary your approach.
As for me, the way I’d do it is simply have/show one set that loads at the beginning.
Once the user has selected an item from the dropdown, I would make an AJAX call passing along the selected item and get back a list of values for the second dropdown.
Then, using jQuery, I would duplicate the row (or div) of the first set all while changing the values in the second dropdown box.
Repeat process for when an item is selected in the second dropdown.
But wait! There’s more!!!
Let’s assume you’ve reached the third set. What if the user decides to change the value in the first dropdown? What are your requirements if that happens? Should you remove all other sets and start back at square one? I guess so…
Since we are not aware of the full set of specs for your tasks, we can only assume stuff and this may (or not) be the best path to take.
Duplicating a row (or a div) using jQuery is quite fun and performance wise, it’s nice.
Keep in mind, you will have to give a different ID to your controls (dropdown + textbox) so when you submit the form, you could use the FormCollection to get those dynamically generated controls.

Joomla: editable list screen

I have a joomla site where users can log in. Once logged in, a user can display a list screen -- say, a contact list with a name column and a phone number column. I call it a list screen, but I guess it could be called a list view, grid view, etc.
I'd like to make one of the columns (say, the phone number column) editable in place; meaning, I don't want to force the user to open a contact editing form. Thus, in the phone number column, a text box should be displayed on each line. The textbox contains the existing data for that row. The user can change the phone number in the text box directly in the list screen, and then press some 'save' icon on that row to save only that row (and only if it has changed). It'd be nice if the saving was done with an AJAX request, but it'd be ok to submit a form for now.
Based on the 'list screen' in the book "Learning Joomla Extension Development", I can currently display the correct list of items for the user. Does any one have example/tutorial of how to do the saving of each row individually? It seems like all list screens that I see have a link which must be clicked to open an edit form, as opposed to allowing editing in place.
Thanks
You have to write a component first. Which will basically do the saving part of the individual row. So basically your component URL takes parameter as row_id phone number etc and have a update query updating the database.
Second is you need to write a javascript function which is called on click of every save button. The javascript function reads row details by reading from the DOM. and then fire an ajax request to the above mentioned component. the URL to the above mentioned component should have format=raw.
The result from the component update queries can be returned as true or false. And accordingly read by javascript ajax response. based on which A flag could be shown saying row updated. I can help you with code further if you describe it in more details

Web Form with more than 100 fields

What would be the best design layout for a web form with more than 100 fields? Right now I have grouped the fields to tabs.I am having tough time in validating the fields.I should either validate it on 'Submit' of the form or on tab change.Both has its own drawbacks. If I validate on tab change then user cannot view other tabs till they fill all the mandatory fields in the previous tab.Also it is not an good idea to throw so many validation messages to the user when he submits the form.
Please share your thoughts..
You can use a stepwise process. In the first step provide all the most important fields. Then on the click of a 'Next' button you can go to the next step and so on. By validating the fields you can allow the user to go to the next step.

Resources