Suppose you have a checkbox in a Drupal webform that needs to be validated before submitting the form. You may be familiar with Drupal form validation but you can add validation using Javascript too. If you have a Drupal form in your Drupal website and want to know how to add Javascript validation to a checkbox to a Drupal form then read on
Many Drupal users wanted to know how to redirect a node-edit form to a custom page after submission in a Drupal 7 based website. If you want to know how to redirect a node-edit form in your Drupal site to a custom page after the form has been submitted then continue reading.
Many Drupal users wanted to know how to add additional form widgets to their Drupal theme settings. If you are facing the same situation in your Drupal site and want to know how to add additional form widgets to your Drupal site's theme settings then continue reading.
The default behavior of drupal_redirect_form in Drupal 6 is to redirect the user to $_GET['q'] when an explicit redirect location is not set in $form_state['redirect']. So any form submission from a Drupal page with additional querystrings like in a paginated form (for example admin content listing forms or admin comment listing forms) will result in the querystrings being lost. This can be frustrating when you administer content from such forms as you have to click the pager link and go back to the previous page after form submission. This can easily be fixed by adding a submit handler for the form in question and setting form_state redirect correctly.
This is how you would normally render a view display passing filter inputs via code:
$view = views_get_view('view-name');
$view->set_display('display-name');
$view->is_cacheable = FALSE;
$filter_1 = $view->get_item('display-name', 'filter', 'filter_1_id');
$filter_2 = $view->get_item('display-name', 'filter', 'filter_2_id');
$filter_1['value'] = "value1";
$filter_2['value'] = "value2";
$view->set_item('display-name', 'filter', 'filter_1_id', $filter_1);
$view->set_item('display-name', 'filter', 'filter_2_id', $filter_2);
dpm($view->render());


