I selected a User Defined Tag Call as field type hoping this would add my code as a field inside the form, but it spits the result out above my form
Any way to accomplish what I am trying or am I not using something in the right way?
Code: Select all
<__script__ src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></__script>
<__script__ src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></__script>
<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"/>Code: Select all
{* Form has a text input field with CLASS customdatepicker as ID attribute is broken in Form Builder 0.7.4!!! *}
{FormBuilder form='contact'}
<__script__ type="text/javascript">
// array below should be build by your UDT or something
var allowedDates = ["24/1/2014","31/1/2014","7/2/2014","14/2/2014"];
function checkAllowedDays(date) {
//get string representation of date
var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getFullYear();
var datestring = day + '/' + month +'/' + year;
// check if date exists in array
if (allowedDates.indexOf(datestring) == -1) { return [false,''] } else { return [true,''] }
} ;
$(function() {
$( ".customdatepicker > input" ).datepicker(
{ minDate: 0,
dateFormat: 'mm/dd/yy',
inline: true,
numberOfMonths: [1, 2],
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
beforeShowDay: checkAllowedDays
}
);
} );
</__script>Code: Select all
<label>Vrijdag: *</label>
<select name="{$FBid}">
{getFridays}
</select>