View Full Version : Resolved Messages showing when shouldn't be

11-23-2010, 10:42 PM
When I have this form loading its loading both messages when I told it to hide it and don't know why. Does anyone else? I looked inside the source code of the form and it's not saying the jquery function is involved.

<script type="text/javascript">
$(document).ready(function() {
$('div.message message-error').hide();
$('div.message message-success').hide();
$("input.submit").click(function() {
$('div.message message-error').hide();
var divisionname = $("input#divisionname").val();
if (divisionname == "") {
$("div.message message-error").show();
return false;
var dataString = 'divisionname='+ divisioname;
type: "POST",
url: "bin/process.php",
data: dataString,
success: function() {
$("div.message message-success").show();
return true;
return false;

<!-- Form -->
<form action="" name="divisionform">
<legend>Add New Division</legend>

<div class="field required">
<label for="divisionname">Division Name</label>
<input type="text" class="text" name="divisionname" id="divisionname" title="Division Name"/>
<span class="required-icon tooltip" id="" title="Required field - This field is required, it cannot be blank, and must contain something that is different from emptyness in order to be filled in. ">Required</span>
<input type="submit" class="submit" name="submitdivision" id="submitdivision" title="Submit Division" value="Submit Division"/>
<div class="message message-error">
<h6>Required field missing</h6>
<p>Please fill in all required fields. </p>
<div class="message message-success">
<h6>Operation succesful</h6>
<p>Everything's going according to plan.</p>
<!-- /Form -->

11-23-2010, 10:59 PM
I think you need to change:

$('div.message message-error').hide();
$('div.message message-success').hide();







Haven't tested it but hopefully that will do it :)

11-23-2010, 11:20 PM
Fixed. Thank you.