I isolated the problem but still couldn't solve it ... I replaced the code for the postcode input field by the code for city commenting out the old code and it worked ... so from there I started to debug the problem code ... so far I found if I copy exactly the same code but replacing the entries corresponding to city by the one from postcode, then the error appears again ... It's related to these functions:
Code:
// function to return field length
// uses $tbl = table name, $fld = field name
function zen_field_length($tbl, $fld) {
global $db;
$rs = $db->MetaColumns($tbl);
$length = $rs[strtoupper($fld)]->max_length;
return $length;
}
////
// return the size and maxlength settings in the form size="blah" maxlength="blah" based on maximum size being 50
// uses $tbl = table name, $fld = field name
// example: zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name')
function zen_set_field_length($tbl, $fld, $max=50, $override=false) {
$field_length= zen_field_length($tbl, $fld);
switch (true) {
case (($override == false and $field_length > $max)):
$length= 'size = "' . ($max+1) . '" maxlength= "' . $field_length . '"';
break;
default:
$length= 'size = "' . ($field_length+1) . '" maxlength = "' . $field_length . '"';
break;
}
return $length;
}
This is the line that's causing trouble ...
Code:
<?php echo zen_draw_input_field('postcode', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', '40') . ' id="postcode"') . (zen_not_null(ENTRY_POST_CODE_TEXT) ?
I din't know if the value 40 is referred to maxlength, or not
the argument $max in the above function ...
Or why it's 40 when the maxlength for that field should be 10 ...
if anyone can explain the way the function works?
I might understand why the input value is 40 instead of what I think ... 10
Bookmarks