Set allowed integer values in CCK select list using PHP

/ Published in: PHP
Save to your folder(s)

This example will return values -15 through 15 to be presented to the user in a select list for an integer CCK field.

Copy this code and paste it in your HTML
  1. $rows = array();
  2. for ($i = -15; $i <= 15; $i++) {
  3. $rows[$i] = $i;
  4. }
  5. return $rows;

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.