I have made a custom field for how many visitors will be at the meeting.
Now they can choose a negative value of visitors, how can i prevent this?
You can't in standard MRBS - you'll need to code it yourself. You can enforce it on the client side by using the HTML attribute min. This should be quite easy to do by modifying the function create_field_entry_custom_field() in edit_entry.php. If you're using the latest version in the trunk (Rev 2768 at the time of writing) then add something like
if ($key == 'my_custom_field_name')
$params['attributes'] = 'min="0"';
just after line 570. (I haven't tested this though)
Ideally you'd also add some checks on the server side in edit_entry_handler.php for those using older browsers and in case users bypass the client side checks.
I might think about incorporating a more generic version of this in standard MRBS.
You seem to have CSS turned off.
Please don't fill out this field.
Ty Campbell for the fast reply, i tested this (using the newest version downloaded from trunk) But it seems not to work . I used mediumint for this field.
I could use $number = abs($number); before writing it into de db.
But i cannot find where to put it. I'm not so good in php ;) .
How doesn't it work? Did you substitute your field name for 'my_custom_field_name'? What browser are you using?
Ok i'm oficialy the dumbest person in the world today.
Forgot to add the field name afters the last edit i made .
Bad idee to edit on 2 different scripts at once :s
Ty Campbell it works :)