This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Advanced hook_form_alter()

This hook is very handy, but in practice I see one possibly big problem. The problem is that any module can use this hook to change some form.

So how can I be sure that my changes will be the last to take effect?

Cheers!

Question about form_set_error

I am updating my mailsave module, but the way the form_set_error() function works is giving me a slight problem, so I just want to understand why it is written like it is. I'm sure there's a reason, but I like to know how things work!

Is there a way for external scripts to consume Drupal functions?

I've experimented by simply trying to include Drupal's bootstrap (similar to how it's done in index.php), but it won't work.

Is there any way to include the bootstrap or something similar so that I could use Drupal's functions in an external script?

Thanks in advance,
Matt

Form Cancel Button w/ Required Elements

I'm looking for ideas here...

I'm revisiting the code to the Ubercart checkout form which you can get to through the "work-in-progress" site at http://livetest.ubercart.org. On the checkout page is a Cancel button that takes the user back to the cart view page. The checkout screen naturally has some required fields to collect customer information.

Now, with a Cancel button, you obviously don't care if the customer has filled out all the required fields. I could just do a switch on $form_values['op'] and if I see t('Cancel') then I send them back to the cart screen. However, it has to go through validation before it ever gets to the submit function, so in validation it's throwing up a bunch of errors for those incomplete fields. This just won't do...

So, I used simple Javascript in that form to put ('onclick' => 'window.location = '. base_path() .'"cart"; return false;') in the attributes. That'll kick us out to where we want to go, and in other places also I've used return false; to keep a form from submitting. The question I have is... what in the world can I do for users who aren't using Javascript? (In this situation and others.)

Is there a way to keep the FAPI from trying to validate these required fields? Right now the button type is useless in FAPI, and I'm not sure that '#submit' => FALSE does anything either.

Up for suggestions or questions if I

limiting nested Forum

I love the possibility for Threaded listing for the comments, but it fucks up your layout, so I would like to limit the number of replies on a comment, is this possible?

Redirecting a user to another node after submitting an html form...

Hello everyone:

I currently control view of menh blocks based on user roles, and have a page where users can change their role, however after posting the change to the database, the web page isn't reloaded and the blocks remain visible, making the whole process a bit messy.

How can I redirect a user to another node/reload the page when they click the form submit button?

The form submit button should act as a link...

Thanks!
Adam

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions