INPUT.required{ ...}
<style>
INPUT.inputfeild1{
border:1px solid #DDD;}
INPUT.required{
background:#FF5555;}
</style>
<html>
<input type="text" class="inputfield1 required" value="">
</html>
<input class="field required" type="text" value="foo"/>
INPUT.field{ ...}
INPUT.required{ ...}
<select name="Answer1" eform="Question 1::1"> <option></option> <option value="1">Yes</option> <option value="0">No</option> </select>
eform="Question 1::1"
eform="Question 1:integer:1"
eform="Question 1::1:Must be a number:#REGEX /^[0-9]+$/i"
eform="Question 1::1:Must be a number:#EVAL return (strlen($value) > 0 and (intval) $value >= 0)"
Select boxes, radio options and checkbox fields
Select boxes, radio options and checkbox fields now have working automatic validation. Any input for these fields is validated against the values set in your form template. This avoids anyone tampering with the form by adding their own values to these fields
Array
(
[0] => 1
)
//<?php $value = substr($attr['value'],1,-1); //strip outer quotes if($value) $validValues[] = $value;
//<?php if(strlen($value)>0) $validValues[] = $value;
@TobyL, can you confirm if changing if($value) to if(strlen($value)>0) (or similar) will not break something unknown to me?Confirmed! In fact in my local working copy I had changed this to if( trim($value)!=’’ ) $validValues[] = $value; which basically does the same except for stripping whitespace chars.
This discussion is closed to further replies. Keep calm and carry on.