How to get all the pages validated, not just the current one, when submitting a form? - forms

First I created a form in Orbeon Forms with Form Builder. Next I made it a multi-page form as described in Create a wizard or multi-page form with Form Builder.
The problem I'm facing is that when submitting the form, validation only occurs on the currently visible sections. When submitting, I would like all sections to be validated even though only one section may be visible. What would be the best way to achieve this?

I would recommend you change the code of your "Next" button so it doesn't switch to the following page if there are errors on the current page. You can do so by adding an if "guard" on the <xforms:setvalue> inside the "Next" button, that reads:
if="xxforms:instance('fr-error-summary-instance')/valid = 'true'"
This will also make things easier for users: if you let them navigate to page 2 while there are errors on page 1, when they try to save while on page 2, you will somehow have to tell them that the error is on a previous page, and provide a way for them to navigate to that page.

Related

How to build a multistep Drupal 7 form with a Bootstrap popup?

I have a multistep Drupal 7 form. I'd like to show it in a Bootstrap Popup.
This form works fine on a normal page however when I put it into a Bootstrap popup it closes the popup when the first button is pressed.
I use drupal_render(drupal_get_form('MYFORMNAME_form')) to put the form into the popup body.
How can I make this multistep form work properly in the popup?
when you say bootstrap popup, do you mean a modal window (http://getbootstrap.com/javascript/#modals)? Modals in bootstrap are defined inside the body of the page and just hidden/shown as needed. If you want one to act as its own window, you need an iframe in it, because submitting the form will not trigger whatever mechanism you put in place to show the modal dialog in the first place.
Another option is to use code to re-show the modal, with the form at whatever stage it is at, with each page load (next button, etc.)
A last option is to do all of the form navigation via AJAX. Then you don't ever need to put the form inside an iframe nor include code to re-show the modal with each submission of the form, since the page never gets refreshed.
IMHO the iframe is easiest, and a decent option if you don't have any qualms about iframes. You just need to place the form in a separate page and include it inside the iframe. Some theming work will enable you to turn off the normal page chrome that will make your modal look like a miniature version of your site -- you probably don't want your header, navbar, footer, etc. inside the modal.
You could use the Popup forms module. It claims:
Works well with multi-step forms. Just don't add [the] "Next" button id to
[the] 'close_buttons' array to keep [the] popup open [when navigating between steps].
This solution is not using a Boostrap Modal ("Bootstrap popup") though rather a jQuery UI dialog. It requires a bit of custom coding to use this module. Example code is provided on the project page.

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.

Wicket modalwindow returning value

I want to create a settings-dialog in my wicket page. I created a ModalWindow that contains a form to achieve this. This works great, the dialog shows up and it contains the form but now I need to return some of these values in the form back to the caller page. Is there someone who could give me pointers on how to do this?
Thanks in advance.
Quote from ModalWindow API:
"If you want to use form in modal window component make sure that you
put the modal window itself in another form (nesting forms is legal in
Wicket) and that the form on modal window is submitted before the
window get closed"
This way when you submit the form in the modal window actually the parent form gets submitted and you get the values transferred.

selenium: web form submitting

I have this task as a homework for interview - to test the webpage of popular site. Got a pop up form with some text in the fields. The task is to check is there are fields has been changed.
The page constructed that way, doesent matter if the data changed, popup window just closed with no additional text about it. I have no idea how to deal with it. Is there any commands in selenium checking, if the form has been sent?
add1
This is a PopUp changing profile window. It is shown below with my translations as the red font.
It is obvious, when this window opens, some values are already in the textfields (that is ur name/surname that u've entered before).
When u press the save button, this page checks if the data been changed since this window been opened (did u really changed anything).
The html code of "save" button has been shown on the pic2. U can see javaScript listener on the save button. There are somewhere must be a JS code, that checks if the data been changed and sends the form, and canceling the form sending, if there's no changing.
My Goal is to check using selenium, if the form has been sent.

In Drupal, how do you get the submit button to appear last on a create content form?

In Drupal, how do you get the submit button to appear last on a create content form without making the entire form from scratch? I can set the weight of the submit button using code, but it never goes below any custom fields I've created. If I drag a lot of custom fields from the bottom of the form to the top, the submit button only stays below about 5 of the fields and then all the other fields get stacked below it. It feels like the submit button is simply stuck in one position on the screen. How do I fix that?
In a hook_form_alter():
$form['submitbuttonid']['#weight'] = 100;
But it seems like something is getting in the way. Typically in Drupal the Submit is always last unless something funny is going on.
Okay, I had just upgraded to the latest version of views and cck. I reverted back to the versions just before that and now the submit button has returned to the bottom of the form. (And a few other niggling errors I never used to have went away)