Default value stopped working

Status
Not open for further replies.

Sadler

Member
Hi,

got a form with a standard input element and in the default I have some php code to generate a random string, in fact it is the example from the Wiki. The eval is set to Yes and it was working just fine. This is the code I have in the default area:

Code:
$length = 10;
  $key = "";
  // define possible characters
  $possible = "0123456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRTVWXYZ";
  $i = 0;
  while ($i < $length) {
    $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
      $key .= $char;
      $i++;
  }
return $key;


This was working fine but at some point in the last 24 hours it has stopped working and if I take off the eval still nothing appears in the field by default, in the past when I took off the eval I would get the actual code showing in the field as the default value.

This does not happen and instead literally nothing is showing in the field.

I have checked the element in the database and the code is showing in the default column of the elements table so it looks like it is just being ignored for some reason.

I have not run any updates of any kind on the site, and as far as I can tell nobody else has run any updates of any kind.

Any ideas?

Burnsy
 
Hi,

I tried to put a default value into another input element and this did not show either.
So I have replaced the files on the server with a copy from the backup from the day before and it works...odd but there you have it!!

Burnsy
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top