Location: PHPKode > projects > ProjectPress > projectpress/pm-includes/tpl/create_topic.tpl
<script type="text/javascript">
$(function() {
$(".newtopic").click(function() {
var topic = $("#topic").val();
var detail = $("#detail").val();
var dataString = 'topic='+ topic + '&detail=' + detail;

if(topic=='' || detail=='') {
$('.success').fadeOut(200).hide();
$('.error').fadeOut(200).show();
} else {
$.ajax({
type: "POST",
url: "create_topic.php",
data: dataString,
success: function(){
$('.success').fadeIn(200).show();
$('.error').fadeOut(200).hide();
}
});
}
return false;
});
});
</script>

<div id="page-title">
	<img src="[@pmurl]/images/comment.png" alt="" /><h1>Forum</h1>
</div>
				
<div class="success" style="display:none">Your topic has been added. <a href="[@pmurl]/forum/forum.php">Click here</a> to go back to the main forum.</div>
<div class="error" style="display:none">Sorry, but you cannot submit blank fields.</div>


<div id="middle">
<a href="[@pmurl]/forum/forum.php">Go Back Forum Homepage</a><br /><br />
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
	<tr>
		<form id="form1" name="form1" method="post" action="[@pmurl]/forum/create_topic.php">
		<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
		<tr>
			<td bgcolor="#E6E6E6">
				<strong>Create New Topic</strong>
			</td>
		</tr>
		<tr>
			<td vAlign="top"><strong>Topic:</strong><br />
				<input class="forminput" name="topic" type="text" id="topic" size="50" style="width:500px" />
			</td>
		</tr>
		<tr>
			<td vAlign="top"><strong>Detail:</strong><br />
				<textarea class="forminput" name="detail" cols="52" rows="15" id="detail" style="width:500px"></textarea>
			</td>
		</tr>
		<tr>
			<td><br />
				<input id="sub_button" class="newtopic" type="submit" name="Submit" value="Submit" /> <input id="sub_button" type="reset" name="Submit2" value="Reset" />
			</td>
		</tr>
			</table>
		</td>
		</form>
	</tr>
</table>
</div>
Return current item: ProjectPress