Guest User

Pre Render HTML Form with Field Values

a guest
Mar 20th, 2012
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. add_filter('gform_pre_render_3','populate_html'); //only populateing html for form id 3 -
  2.  
  3. function populate_html($form){
  4.  
  5. foreach($form["fields"] as &$field) {
  6. if($field['id'] == 91):
  7. $field['content'] = '<p>Please view your details and confirm your quotation by submitting the form</p>';
  8. $field['content'] .= '<ul>';
  9. $field['content'] .= foreach($form['fields'] as &$field) {;
  10. $field['content'] .= '<li>';
  11. $field['content'] .= if($field['id']!=91): echo $field['label'] endif;
  12. $field['content'] .= '</li>';
  13. $field['content'] .= };
  14. $field['content'] .= '</ul>';
  15. endif;
  16. }
  17.  
  18. return $form;
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment