jQuery validate e-mail address
A script with jQuery to validate e-mail address an a form. It changes the class of the form to 'error' and disable the send button if not valid.
A script with jQuery to validate e-mail address an a form. It changes the class of the form to 'error' and disable the send button if not valid.
A short script for jQuery that validates two password fileds so they have the same value and a minimum length.
This module allows you based on your choice of node types skip the form validation on Delete. This can be done in two ways either by the Delete button or by an extra tab link beside View and Edit. The confirm dialogue will still remain.
Here is how you can toggle an action depending on a checkbox is marked or not. In this case added to a Drupal 6 form item checkbox.
I had to prevent Drupal from deleting a node and instead run my own functions to act on "delete" operation. I used the form_alter hook and removed the delete button and added my own button called Remove. This don't prevent users from calling the node/[nid]/delete, you have to set that in the permissions instead.
This is how to clear form cache when other parameters don't work. I'm using it when clear Drupals cache on AHAH forms.
<?php
cache_clear_all('form_'. $_POST['form_build_id'], 'cache_form');
?>
This is how you can embed forms in to a Views view in Drupal 6 with the module Views Embed Form.
//Create a hook_views_embed_form
//Needs to be [your module name] + '_views_embed_form' but can exists in a inc file
function mymodule_views_embed_form() {
//Set a user permission if needed
if (user_access('administer workflow state')) {
return array(
'mymodule_embedded_ticket_form' => t('My form name'),
);
}else{
return array(); //I added this to avoid error message if user has no access to the form
}
}
//Create a form, remember
This is how you can override the select form options by hook_select and add your own theme function. In my case I wanted to add different classes to each option.
The Drupal forms API 6.x has no good example and the book Pro Drupal Development from 2008 is not correct in the way the 'url' item should be set. Here is an example of Drupal AHAH progress bar with working percentage.
Based on good article referenced below, I have added some more form items to be used in my case.
When adding more columns or removing, it is important that the number of header items is the same as the number of columns, if you have less header items the drag and drop will not work.
I have added an extra row to be able to add new items.