Response title
This is preview!




// Defines that we are calling a function//
$(function(){
// 13 = the return key, when return is pressed inside the div "createcat" then trigger the function
$('#createcat').live("keypress",function(e){
if(e.which == 13)
{
//Variable, inputbox is echoed through following post script when
//the value is equal to what is contained in the box.
var inputbox = $(this).val();
//Execute script once Return is pressed on keyboard
//Send a XMLHttpRequest to process the rest of procedure.
if(window.XMLHttpRequest)
{
xmlhttp = new window.XMLHttpRequest //Variable
}
else
{
xmlhttp = new ActiveXObject ('Microsoft',XMLHTTP);
}
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState == '4' && xmlhttp.status == '200')
{
}
}
//Defines the parameters in use, Variable line 10.
parameters = 'inputbox=' + inputbox;
//Posts the information to the PHP script, create-cat.php
xmlhttp.open('POST','scripts/create-cat.php',true);
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlhttp.send(parameters);
}
});
});
<!--////////////////////////////////////////////////////////
// Project : Absolute Beginners log in system ///////////
// Purpose : A2 Level Coursework for ICT ////////////////
// Teacher : Mr L Hawkins ///////////////////////////////
// Student : Alex Sims //////////////////////////////////
// Candidate No. : 4173 /////////////////////////////////
// Centre No : 27168 ////////////////////////////////////
/////////////////////////////////////////////////////////-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"/></script>
<script type="text/javascript" src="javascript/create-cat.js"/></script>
<script type="text/javascript" src="javascript/custom.js"/></script>
<?php include_once('includes/header.php') ; ?>
<script type="text/javascript" >
$(document).ready(function() {
$("#markItUp").markItUp(mySettings);
});
</script>
<div id="subheader">
<div class="col-full">
<ul id="submenu">
</ul>
</ul>
</ul>
</div> <!-- end subheader -->
<!-- Start Main Div section -->
<div class="col-full">
<div id="leftsection">
<h2>Create Posts</h2>
<div class="form-elements">
<input type"text" name"title" placeholder="Add Title Here" id="title"/>
</div><!-- End of Left Section -->
<div class="form-elements">
<textarea id="markItUp" name"content"></textarea>
</div> <!-- Installed Text Editor -->
<div class="form-elements">
<input type"text" name"metatitle" placeholder="Meta Title" id="metatitle"/>
</div>
<div class="form-elements">
<input type"text" name"metadescription" placeholder="Meta Description" id="metadescription"/>
</div>
<div class="form-elements">
<input type"text" name"metarobots" placeholder="Meta Robots" id="metarobots"/>
</div>
<div class="form-elements">
<input type"text" name"metatags" placeholder="Meta Tags" id="metatags"/>
</div>
<div id="rightsection">
<h2>Categories</h2>
<div id="listcategores">
<div class="form-elements2">
<input type="checkbox" name="categoryname" value="" id="categoryname"/> Category 1
</div>
<div class="form-elements2">
<input type="checkbox" name="categoryname" value="" id="categoryname"/> Category 2
</div> <!-- end category list -->
<div id="createcat">
<div class="form-elements">
<input type="text" name"categorycreate" id"categorycreate" placeholder="Add New Category"/>
</div><!-- end createcat-->
<div class="clear"></div>
</div><!--end mainWrapper-->
</body>
</html> © 2010 The jQuery Project
Sponsored by
and others.
