Is it possible to have options on select change from when other select changes without javascript - ruby-on-rails

There are a bunch of question on this but no answers on how to do it without javascript.
If you have one form that has 2 select boxes. The second select box has different options based on what you choose for the first select box. Here is a js example. Not all users have js enabled so for these users this option would be unavailable.
Can this be achieved solely using CSS3, HTML5 and Ruby? I would show what I've got so far in trying this but I got nothing.

What you are asking is how to manipulate the DOM after it has loaded without a client-side scripting language. This is not possible as far as I am aware; unfortunately that is not what you want to hear.
The proper solution in this case would be to have the user submit the page and generate the second selection box at that time. You will have to rely entirely on server-side logic to handle the problem. So basically something like:
Serve a page with just a single selection box
When the page is posted generate a similar page where the first selection is locked and display a second selection box with the possible options.
Continue the iteration until you have all of the required selections filled out by the user.
Serve the result that the user requested.

Related

How to disable textbox dropdown suggestions on certain websites?

I am trying to make my job easier by creating simple AHK scrips to auto-fill certain forms online.
Im not really good at explaining, but hopefully someone will understand what Im saying. The problem is that this website has certain textboxes with dropdown auto-suggestions turned on, and it has a delay when selecting those textboxes. I assume when selecting textbox it is pulling data from some database which is causing delay. Now my question is. Is it possible to turn off dropdown menu on websites or even in entire browser if necessary? I really want to my script to tab-in, wright down whats needed, tab-out without delay.
Autocomplete dropdown lists are just JS scripts. So there is no way, I think, to disable them by clicking checkbox in browser settings.
First, try to disable JS completely.
Also, if only few sites are involved, you could try to find out what JS libraries are used and disable them in browser JS console.
Are you planning to do this via keypresses or via COM?
I imagine that via keypresses you could not avoid focusing the elements and triggering the information lookup.
AutoHotkey can interact with webpages on Internet Explorer using COM (Component Object Model).
COM can launch/latch onto an IE instance, detect if the page is loading/has loaded, navigate to a particular url, and set the text of web elements,
quite possibly without triggering the drop-down lists. I haven't tested if COM can disable elements, it's possible.
Also, Acc.ahk may be able to set the text of elements.

f.select - disabling option based on the first one selected in Rails

I have a form in which user can select two players from a list (two separate select fields). I managed to do it using options_for_select helper, but
user shouldn’t be allowed to select the same player twice - it obviously can't be something like player1 vs player1. I was experimenting with ‘disabled’ option, but without success, because list of available users should change dynamically after selecting first user, which probably can't be done in Rails?
This is a very broad question, with little details, hence my answer will be generic to cover the majority of cases.
You'll have to use JavaScript to hide the same options from the other list. Rails works server-side, therefore you should reload the page if you want Rails to re-render the list without the selected option. But this is a terrible user experience.
However, you should also perform a server-side check. Even if you add the JS in place, it will still be possible to send a crafted request where the players are the same. This is something that must ultimately be verified at server-side level, in your Rails controller or wherever you have the logic to handle the comparison.

Does jQuery Mobile have a (true) combo-box?

I am searching for a way to create a combo-box in jQuery Mobile, but there seems to be a lot of confusion between a combo-box and a select (drop-down) box.
My definition, which I learned back when dinosaurs were using Windows 3.0, is that a select box allows you to choose from a drop-down list. A combo-box does this, but adds the ability to type anything at all (a 'combo' of a selection drop-down and a text input). These days, from my searching, the distinction seems to have been lost, which is making it extremely difficult to track down info about true combo-boxes.
I like jQuery Mobile's over-all simplicity, and I love the auto-search/complete feature that displays matching options as you type which is 90% of what I need, but I want to capture whatever the user enters, whether it is on the list of options or not. Can I do this without headache / major work / another plug-in?
jQuery has combo box, but not JQM...
try this url: devcurry.com/2011/05/jquery-editable-combo-box.html maybe u can customize it...

Update form based on dropdown selection

I'm new to Rails and I'm trying to figure out how to change either the fields in the form, or the form itself, based on the selection of a drop down menu. I have thought about using AJAX, or about embedded Ruby within the form. Any direction would be great.
Well, obviously there will be javascripts involved at some point.
I think there are 2 solutions for you to choose from:
using ajax to fetch the new data to change your form upon dropdown changes
loading everything you need from the first time (when landing to the page) and then displayhing/hiding things only using javascript
Starting from this, I suppose your decision will be made depending if you want/can afford loading everything you need from the beginning... and if not you'll probably go with ajax.
Let us know if you need some more details. : )

gui with multiple interfaces?

I am trying to create a GUI using jquery and html to allow users to enter information into a system. The problem is, I don't know how to create a GUI that will show different interfaces for each step.
For example, I want to have users enter in their personal information in step 1. When they click next, they can choose a photo from a set of photos that appear, and so on.
I suppose I can name different html divs and make them show and hide at certain times as desired. But is there a cleaner technique for doing something like this?
You could use one of the JQuery Form Wizard extensions.
For example:
http://thecodemine.org

Resources