Rails form select from two options with a button - custom form implementation - ruby-on-rails

I have a website where I want users to be able to select what type of user they are during the registration process.
Specifically, the implementation I want is to have two buttons on the signup page, one called "Seller" and one called "Buyer".
The user should be able to select only one button and once clicked, it should stay highlighted (I know this is just jquery so not the issue).
The selection should be stored in a column in my users model called :type.
It seems pretty straightforward, but the "f.select" form method seems to only implement a dropdown menu, so I am wondering how I can achieve this implementation of two buttons.

Since you're already going to use jQuery, you could add a hidden field for type, create 2 links and style them as buttons, and use jQuery to update the value of type when a user clicks one of the "buttons".

Related

Adding multiple dropdown on clicking a link

I have a link which says "add another field". On clicking the link a dropdown should appear on top with let's say 5 custom fields as list in dropdown. Once user selects a field in that dropdown and clicks hyperlink another dropdown should appear below existing dropdown and with only 4 remaining fields as one is already selected.so how to start this?
https://tutorialslink.com/Articles/How-to-add-control-dynamically-in-Aspnet-MVC-using-Javascript/64 . I have tried to use this link which adds text boxes to get started.
I don't have any code expect for the code in above link which is for text box though. Just need an idea of how to do it in asp.net MvC as i cannot move forward now.
Expected results is to do the above requirement, don't have any actual results as of now

Is there any pop up dialog control in Orbeon form builder

Is there any pop up dialog for select data for a text box in Orbeon Form builder. Which will allow user to search item and select for a text box on Form runner.
There is no control that uses a pop-up dialog for the search. However:
In some cases the autocomplete can be used for that purpose, if the amount of information the autocomplete shows is enough to allow users to make a choice. Once an item has been selected, you can show more information related to the selection that was made in other controls.
Once RFE #3803 is implemented, which is planned for 2018.2, you'll be able to use any field (or a combination thereof) for the search, and a repeated grid to show results.
Finally, you could implement your own component that uses a pop-up, and plug into Form Builder. But of course, depending on the situation, it is possible that this could call for a larger investment in time than acceptable.

how to set maximum selection of checkbox in a dialog in advanced installer 8.9?

Advanced Installer 8.9
I have 9 check-box on a selection dialog ,on which i need to allow maximum selection of any three check-boxes.
We can show a message box displaying that only three can be selected or disable next button .
Trying to do permutation and combination will be a filthy task,is there any way where i can set a counter which increments on selection of check-boxes.
The easiest way is to create a very simple custom action in C# that checks the value of each property attached with your checkboxes. You need to call this DLL using a published event, from each checkbox, so when a user tries to select it, first the custom action checks to see if other checkboxes are not selected. If there are already 3 checkboxes selected then you need to delete the property of the new checkbox, like this:
session["CHECKBOX_PROP_1"] = "[~]";
Of course you can also use a C++ custom action if you prefer this language.

Variable-length form submissions

I'd like to create a form_for statement which allows the user to select elements one-by-one from a drop down menu (or an auto-complete field). As the user selects each item, they should be displayed in list format at the top of the screen. When the user has finished selecting elements, the form can be submitted and the list of selected elements is sent to the receiving controller action.
Can someone tell me how to implement this?
Maybe Chosen is what you need.
Take a look at:
http://harvesthq.github.com/chosen/

I have a form where i want to add more input fields on button click in MVC View without scripting

I am a newbie, i am trying to create a view where every time i click on add more link next to a Textbox, another text box appears. How do i do that? I searched the same question on this site but i could not find a solution.
You'll have to create an array (string[] Smth)in your model. Then you have to make your "add more" link to submit your form to controller action that will add another element to this array and roundtrip back to view.
You may take a look at the following article which illustrates how you could handle dynamic rows.

Resources