Library Home Princeton University Home
Friends of the Princeton University Library
\n\t\t\n\t\n\t\n\t\t\n\t", "name"); $renderer->setElementTemplate("\n\t\n\t\t\n\t\n\t\n\t\t\n\t", "email"); $renderer->setElementTemplate("\n\t\n\t\t\n\t\n\t\n\t\t\n\t", "subject"); $renderer->setElementTemplate("\n\t\n\t\t\n\t\n\t\n\t\t\n\t", "join"); $renderer->setElementTemplate("\n\t\n\t\t\n\t\n\t\n\t\t\n\t", "comments"); $head_tpl = "\n\t\n\t\t\n\t"; $form_tpl = "\n\n
 
Return to Friends Home
Calendar of Events
Acquisitions Programs: Help the Library Acquire New Items
PU Library Chronicle
Visiting Fellowships
Mission
Join the Friends
 

Comments and Inquiries
addElement('header', null, 'Send a comment or an inquiry'); $form->addElement('text', 'name', 'Your Name:', array('size' => 30, 'maxlength' => 60)); $form->addElement('text', 'email', 'Your E-mail Address:', array('size' => 30, 'maxlength' => 60)); $form->addElement('text', 'subject', 'Subject:', array('size' => 30, 'maxlength' => 80)); $form->addElement('checkbox','join','','Please send information about joining the Friends'); $form->addElement('textarea', 'comments', 'Comment or Inquiry:', array('cols' => 50, 'rows' => 5)); $tm =& HTML_QuickForm::createElement('submit',null,'Send Comment or Inquiry'); $grp[] = $tm; $tm =& HTML_QuickForm::createElement('reset',null,'Clear Form'); $grp[] = $tm; $form->addGroup($grp, 'buttons', ' '); // Define filters and validation rules $form->applyFilter('name', 'trim'); $form->addRule('name', 'Please enter your name.', 'required', null, 'server'); $form->addRule('email', 'Please enter your complete valid email address.', 'required'); $form->addRule('email', 'Please enter your complete valid email address.', 'email'); // Try to validate a form if ($form->validate()) { $form->freeze(); $form->process('process_form', false); #mail('abarrera@princeton.edu','test','test'); echo "

Thank You, ".$form->exportValue('name')."

Your comment/inquiry was submitted, and we will respond shortly.

"; } else { $renderer =& new HTML_QuickForm_Renderer_Default(true); $renderer->setElementTemplate("\n\t
*\n\t\t{label}
{error}
\n\t\t{element}
*\n\t\t{label}
{error}
\n\t\t{element}
*\n\t\t{label}
{error}
\n\t\t{element}
*\n\t\t{label}
{error}
\n\t\t{element}
*\n\t\t{label}
{error}
\n\t\t{element}
{header}
\n{content}\n
\n"; $renderer->setFormTemplate($form_tpl); $renderer->setHeaderTemplate($head_tpl); $form->accept($renderer); echo $renderer->toHtml(); #$form->display(); } function process_form ($values) { $headers = "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "X-Mailer: PHP\r\n"; $headers .= "X-Priority: 3\r\n"; $headers .= "From: ".htmlspecialchars($values['email'])."\r\n"; $headers .= "Reply-to: ".htmlspecialchars($values['email'])."\r\n"; $omsg = 'Requestor: ' . htmlspecialchars($values['name']) . ' - '.htmlspecialchars($values['email']) . "

\r\n"; if ($values['join']=='1') { $omsg .= "Please send information about joining the friends.

\r\n"; } $omsg .= 'Comments: ' . htmlspecialchars($values['comments']) . "

\r\n"; mail('abarrera@princeton.edu','Friends Comment:'.htmlspecialchars($values['subject']) . ' ', $omsg, $headers); } ?>


libraryf@princeton.edu


PU home
© 2001, 2005 The Trustees of Princeton University
Princeton University, Princeton, New Jersey 08544
Friends of Princeton University Library

Copyright infringement reports