form
Drupal 7 Expanded Menu Control On Nodes
Thu, 12/01/2011 - 10:02 | by philipnorton42I recently noticed a strange little issue with Drupal 7 that seemed like either an oversight or a decision I don't agree with. Essentially, when a node is created with a menu item in place the extended flag on the menu will not be set, but the control is also not available on the menu admin page. This means that when you are trying to print out a hierarchical menu structure you need to create the page, go into the menu admin area, access the menu, click on edit to access the menu item and change the setting there.
Drupal 6 Form Elements Example Module
Wed, 09/21/2011 - 12:59 | by philipnorton42During my work developing Drupal sites I am quite often asked if I can provide a example of form elements for designers. This is so that they can test their designs with all possible form elements that might appear in a Drupal install and make sure that the theme we create will be robust and future proof. I often find myself forgetting how to create, say, a multi select element and needed a sort of cheat sheet that I could look form elements up on.
PHP Question: Post Variables
Fri, 07/29/2011 - 17:10 | by philipnorton42Question
Take the following HTML form.
<form id="form" name="form" method="post"> <input type="text" name="number" value="0" /> <input type="submit" /> </form>
What is the output of the following PHP code after the above form has been submitted, and why?
if ($_POST['number'] === 0) {
echo 'number is zero';
} else {
echo 'number is not zero';
}
PHP Question: Form Variables
Fri, 04/22/2011 - 15:27 | by philipnorton42Question
Given the following form:
<form method="post" action="index.php"> <input type="input" value="" name="text" /> <input type="submit" value="Submit" /> </form>
How would you get hold of the value of the input box after the form is submitted?
Overriding Drupal 6 Automatic Select Element Validation
Tue, 03/29/2011 - 09:00 | by philipnorton42Whilst creating a large and complex form in Drupal 6 recently I hit upon a problem that took me a couple of hours to solve so I am posting the solution here in case anyone else gets similarly stuck. I am also writing this down so that I can remember the strategy in case I have to do the same thing again.
Change Views Exposed Filter Form Select Element To A List Of Checkboxes
Wed, 05/12/2010 - 11:04 | by philipnorton42Whilst creating a view for a Drupal site the other day I created an exposed form but rather than the usual select boxes that get displayed I needed them to be a list of check boxes. Whilst searching about on Google I eventually found this article, which kindly provides a function that will do this. Here is the function in full.