use one text box with multiple form submit buttons ruby on rails - forms

I'm making an app where I have multiple forms on one page but they are all similar; there is a text box and a submit button.
What I would like to do is consolidate all text boxes into one then have many submit buttons. That way the user inputs the data once in the obvious text box at top then decides which category (submit button) he would like to apply the data in the input box to.
Is this possible? I can't find and documentation on how to do this. Thanks!

You can do so by using <%= fomr_tag url: "/myCust" do %> method to create a form and wrap all the fields inside form tag. on submit button you will be redirect to /myCust method.
There you can get all the params in myCust method. You are using rails 4 then define all params under private method as it does. Store each of them. as you may want.

Related

Post values using forms and display front end

I am very newbie to drupal 8 ,I want to add Content from back end and list in front end.
I tried to create a contact form from back end.here is my form
I don't want to send emails.only display the added item
After submit to database i want to list items.is this method is wrong?
But now the contact form not listing anything?Is my way is okay? please correct me
Create content type with your field like Name and PDF then there will be following options to display on front page:
Tick the box - promoted to front page
Create a new Drupal page view using views to display the content on front page.

Nested redux-forms: voucher form inside checkout form

I'm trying to make a checkout page with a nested coupon code / voucher subform using redux-form.
So the checkout form would include for example a Country selection and inside this form I'd like to add a sub form to apply a Voucher.
The user needs to be able to apply a voucher separately from the main checkout form to view the possible discount.
When submitting the general checkout form the voucher must also be validated in case it wasn't applied.
What would be the best way to implement this?
I understand I can't simply nest reduxForms. I don't want to create 2 seperate forms, because i'd like to show possible validation and submit errors of the general checkout form also below the voucher field
I might be able to use asyncValidation for the voucher field, but I'd like to trigger that with a apply button instead of a field blur.
In the end I've implemented this using asyncValidation. To trigger this, not when leaving the voucher field but when clicking the apply button I created a custom Field component with the textfield and button. The textfield gets the whole input except the onBlur function, the button's click handler calls the input.onBlur.
Because it's a field I could also easily use the meta information to disable the button when appropriate.
Feels like quite a hack, so better solutions are welcome.

can i use fancybox for an online form contact?

I'm creating a contact form, which I want to be pop out (and greyed) and wanted to know if fancybox could be used for this purpose. I currently use it for images but curious to see if it could work for this purpose.
You can use fancy box for a form.
You might have to make some changes to the plugin to get it work though
you can see how to do it here
Based on your comment: There are a few ways to get that done:-)
One way, is to have multiple divs within the form. Make the next button hide one div and show another in the modal. This can be done as many times as you need to do it within the same modal. Then when the form is complete, you can have a submit button now instead of a next or previous button.

Why does my access form lose focus

I have a Microsoft Access form which I use for entering client information:
First name
Last name
etc..
My problem is when I tab away from the Access Form to view the information which needs to be entered, the focus is lost in access. I need to click the form with the mouse to regain the focus.
This is very annoying!
Any help here?
AS far as I know, the focus of an access object is lost when you clic anything outside the object... that includes forms.
I can suggest you two ways of tacling this:
Use a control (combo box or list box) inside your form, so you can view the data you need.
Use a "pop up" form: you can create a form with the data you need, and a button inside your main form that opens this "pop up" form. You can specify in VBA if you want your form to open as a pop-up... if I remeber correctly, is something like this:
...
docmd.openform("frmYourForm",,,acDialog)
...
Hope this helps you

How do I create an "iframe popup" when I hover over an <a> tag?

Here is the scenario: a User will see a list of company names, each wrapped in an tag. He is able to see dynamic information and as he hover over each name and then make a request.
So Given a list of companies, each wrapped in an tag.
When the cursor hovers over an tag
Then a "pop-up" appears that contains an -based, dynamic content.
Given the pop-up
When the User clicks on the "submit" button in the pop-up
Then the form (based on the framework" is submitted and ajax displays "request succesful"
So, because I am using a php-framework, I'd like to use iframe to contain the form.
Some challenges:
When the cursor is no longer hovering over the tag, the hover disappears. How do I keep it operating?
How do I make it appear in an so I can have full form-submission and POST-ing dynamic values through the URL?
How do the "popup" disappear when the cursor is no longer on either the -tag or the pop-up itself?
Can I do it without loading a bunch of 's onto the page, because the list of companies could be long.
for an example:
http://browseusers.myspace.com/Browse/Browse.aspx hover over one of the link.
jQuery with the clueTip plugin is something I have used for this in the past.