http://jsfiddle.net/8tAK7/
plzz look at this script this works in perfectly in this site..I wrote this as script
but It does not work in wampserver...
here is my code :
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
$("#add_item_btn").click(function(){
$("input[name=item_desc], input[name=item_price], input[name=item_qty]").val("");
$("#detail").fadeIn();
});
$("#insert_item").click(function(){
var item = $("input[name=item_desc]").val();
var price = $("input[name=item_price]").val();
var qty = $("input[name=item_qty]").val();
if(!item){
alert("Please fill the field.");
return;
}
var val = item + ";" + price + ";" + qty;
$("#items").append("<li>" + val + "</li>");
$("#my_form").append('<input type="hidden" name="items[]" value="' + val + '"/>');
$("#detail").fadeOut();
});
</script>
</head>
<body>
<form id="my_form" method="POST">
Here your basic form<br />
<br/>
Your Items: <br />
<ul id="items">
</ul>
<br/>
<input type="button" value="Add Item" id="add_item_btn" />
<br/>
<input type="submit" value="Create purchase request" name="submit" />
<input type="reset" value="reset" />
</form>
<br/>
<div id="detail" style="display: none">
Item Description: <br />
<input type="text" name="item_desc" /><br />
Item Price: <br />
<input type="text" name="item_price" /><br />
Item Qty: <br />
<input type="text" name="item_qty" /><br />
<input type="button" value="Add" id="insert_item" />
</div>
</body>
</html>
wht's the wrong??here,,plzz help me fix the error of this my hard code script....