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

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)

Related

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.

Usability for confirm message in a long form

I term of usability, I'm wondering what's the best solution to display my confirm message.
I have a long form, and in small screen I can't see the top of the form.
When I'm submitting my form, where is the best position for my message "Your information has been saved"?
In the top of the form, and I add an automatic scroll up ?
In the bottom close to the save button?
In a dialog box?
Other solutions?
I tried to find that on Internet but nothing really interesting. Please quote your source if you have an answer for me.
Thanks!
If this is the only place in your application that has this functionality, it doesn't matter so much; if you already have it working one way or the other somewhere else, consistency is the most important.
Where will the user need to navigate to next? If navigation is at the top, auto-scrolling them to the top and showing a message there might be appropriate.
If the navigation is on the left side, auto-scrolling will lose the user's place in the page, which will make navigation harder. In this case, tell them right next to the submit button.
If there's only one place they can navigate to next, skip the AJAX and do an interstitial "success!" screen that also takes them to the next place they'll want to navigate.
But most of all? Consistency with the rest of your app.

Jasper Reports - remove buttons from input control

I've been digging all over Jasper documentation and can't find the answer.
Currently for our reports, we have a simple input control, Date. When this launches, I am given a date control and at the bottom, I get series of useless button choices...
Apply, OK, Reset, Cancel, Save
Can anyone help me get these removed? Just want OK and Cancel. I looked at DefaultParametersForm.jsp but am having a hard time finding anything useful there. I'm an amateur jsp programmer.
We removed the Cancel button from the input control popup, we found it in the file inputControls.jsp in the jsp/templates directory.
You should find the apply, ok, reset and save button here also.
I do not know off-hand how to remove the buttons, but these buttons are not all useless. Reset clears your fields back to their defaults (blank if no default).
When you are using the Control Layout 1, you may think the Apply and OK button do the same thing but they don't. Apply will run the report with the set parameters, but will not get rid of the dialog box. OK runs apply and removes the dialog as well. (Note that the dialog can be dragged out of the way.)
If you switch to one of the other Control Layouts (I like 4), then the OK button goes away b/c there is no longer a dialog. You will only get Apply, Reset, and Cancel.

UIWebView not Displaying Keypad

I been trying to debug a problem with some odd behaviour inside a UIWebView. My app uses a UIWebView to display a custom form to collect certain information. When the form is first loaded, filled and submitted, everything behaves as it should. After the first submit, when the form is reloaded, the keypad will not display (but the content scrolls as though it is).
The only solution I have come across is here, but this does not seem like the solution to my problem since that line is already in my app delegate.
Is this a known issue? I don't even know where to start looking to debug this issues.
After much searching SO and Apple forums, it was the view hierarchy that was getting rearranged. In my particular case, a progress indicator was being added as new window (by a coworker, so I can blame someone else for this). The trick was not set this new as the key window and only manipulate the the hidden properties
This is just a quick fix because it was only one line of code that was causing this major problem.

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

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.