mantismamita
7/16/2014 - 8:55 PM

form.php

<?php
/*
 * This function outputs HTML for the backend editor.
 * The naming convention is: ninja_forms_field_4[custom_value].
 * It will be available as $data[custom_value].
 *	
 * $field_id is the id of the field currently being edited.
 * $data is an array of the field data, including any custom variables.
 *
*/
function budget_field_edit( $field_id, $data ){
  if( isset( $data['budget_value'] ) ){
    $budget_value = $data['budget_value'];
  }else{
    $budget_value = '';
  }
  ?>
  <input type="text" name="ninja_forms_field_<?php echo $field_id;?>[budget_value]" value="<?php echo $budget_value;?>">
  <?php
}
 
 
/*
 * This function only has to output the specific field element. The wrap is output automatically.
 *
 * $field_id is the id of the field currently being displayed.
 * $data is an array the possibly modified field data for the current field.
 *
*/
function budget_field_display( $field_id, $data ){
  if( isset( $data['budget_value'] ) ){
    $budget_value = $data['budget_value'];
  }else{
    $budget_value = '';
  }
  ?>
<div class="range_wrapper">
	<label id="rangelabel" for="budget">500 &euro;</label>
	<input type="range"  name="_budget" id="budget" min="500" max="10000" value="500" step="50" onchange="rangevalue.value=value + ' €'">
	<label for="budget">10 000 &euro;</label>
</div>
	<label for="ninja_forms_field_<?php echo $field_id;?>"><?php _e('Minimum Budget', 'kirsten' ); ?></label>
  <input type="text" name="ninja_forms_field_<?php echo $field_id;?>" value="<?php echo $budget_value;?>" id="rangevalue">
  <?php
}