I have just taken over a partially complete Joomla site build and the contact form they have is using Chronoforms. I have set up server side validation to check for required fields not being empty but when I fill out the form and leave one of those fields blank, I get the error message showing as it should but the form fields are blank again, losing everything in the form which was there prior to hitting Submit. I have set the "Republish fields if error occured" setting to be "Try to republish" but this seems to have no effect.
Under the Validation tab I've set Javascript Live Validation to Enable Validation = No and Enable Server Side Validation = Yes
Server Side code is as follows:
No plugins are being used, no captcha, no file uploads and the data is being emailed and not stored in a database. Any pointers as to where I might start to rectify this would be much appreciated.
Form code is as follows:
Under the Validation tab I've set Javascript Live Validation to Enable Validation = No and Enable Server Side Validation = Yes
Server Side code is as follows:
<?
$name = JRequest::getString('text_1','', 'post');
if ( !$name ) {
return 'Please fill in your NAME';
}
$company = JRequest::getString('text_2','', 'post');
if ( !$company ) {
return 'Please fill in your COMPANY NAME';
}
$phone = JRequest::getString('text_4','', 'post');
if ( !$phone ) {
return 'Please fill in your TELEPHONE NUMBER';
}
$email = JRequest::getString('text_3','', 'post');
if ( !$email ) {
return 'Please fill in your EMAIL ADDRESS';
}
$message = JRequest::getString('text_8','', 'post');
if ( !$message ) {
return 'Please fill in your MESSAGE';
}
?>
No plugins are being used, no captcha, no file uploads and the data is being emailed and not stored in a database. Any pointers as to where I might start to rectify this would be much appreciated.
Form code is as follows:
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Your Full Name*</label>
<input class="cf_inputbox required" maxlength="150" size="30" title="Enter your full name here" name="text_1" id="text_1" type="text" value="" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Your Job Title</label>
<input class="cf_inputbox" maxlength="150" size="30" title="Enter your job title" name="text_0" id="text_0" type="text" value="" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Your Company Name*</label>
<input class="cf_inputbox required" maxlength="150" size="30" title="Enter the name of your company" name="text_2" id="text_2" type="text" value="" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Telephone Number*</label>
<input class="cf_inputbox required validate-number" maxlength="150" size="30" title="Enter a valid phone number" name="text_4" id="text_4" type="text" value="" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Email Address*</label>
<input class="cf_inputbox required validate-email" maxlength="150" size="30" title="Enter a valid email address" name="text_3" id="text_3" type="text" value="" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textarea">
<label class="cf_label"><strong style="color:#000;">How can we help you?</strong><br />Please leave a message*</label>
<textarea class="cf_inputbox required" rows="6" title="Enter your message" cols="30" name="text_8" id="text_8" value=""></textarea>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_9" id="submit_btn" type="submit" />
</div>
<div class="cfclear"> </div>
</div>