嘿,有人可以幫我做這個對象嗎。任何人都可以幫助我使這個對象。 (php)
顯然不是我所有的代碼都在這裏,但我相信你會得到這個主意。
<?php
$product_name_1 = $_POST['product_name_1'];
$region_1 = $_POST['region_1'];
$start_date_1 = $_POST['start_date_1'];
$end_date_1 = $_POST['end_date_1'];
$sku_1 = $_POST['sku_1'];
$product_name_2 = $_POST['product_name_2'];
$region_2 = $_POST['region_2'];
$start_date_2 = $_POST['start_date_2'];
$end_date_2 = $_POST['end_date_2'];
$sku_2 = $_POST['sku_2'];
$product_name_3 = $_POST['product_name_3'];
$region_3 = $_POST['region_3'];
$start_date_3 = $_POST['start_date_3'];
$end_date_3 = $_POST['end_date_3'];
$sku_3 = $_POST['sku_3'];
?>
<form action="" method="post" accept-charset="utf-8">
<div id="product_information">
<table id="product_1">
<tr>
<th><label for="product_name">Product Name</label></th>
<th><label for="region">Select A Region</label></th>
<th class="date"><label for="start_date">Start Date</label></th>
<th class="date"><label for="end_date">End Date</label></th>
<th><label for="sku">SKU</label></th>
</tr>
<tr>
<td><input type="text" name="product_name_1" value="" id="product_name_1"></td>
<td><input type="radio" name="region_1" value="upper_north" id="upper_north_1"><label for="upper_north_">Upper North Island</label><br />
<input type="radio" name="region_1" value="lower_north" id="lower_north_1"><label for="lower_north_">Lower North Island</label><br />
<input type="radio" name="region_1" value="south_island" id="south_island_1"><label for="south_island">South Island</label> </td>
<td class="date"><input type="text" class="date" name="start_date_1" value="" id="start_date_1"></td>
<td class="date"><input type="text" class="date" name="end_date_1" value="" id="end_date_1"></td>
<td><input type="text" name="sku_1" value="" id="sku_1"></td>
</tr>
</table>
<span class="product"></span>
<div class="add-product"> </div>
</div>
<script type="text/javascript" charset="utf-8">
var i = 1;
$('.add-product').click(function(){
i++;
$('span.product').replaceWith('<table id="product_'+i+'">'
+'<tr>'
+'<th><label for="product_name">Product Name</label></th>'
+'<th><label for="region">Select A Region</label></th>'
+'<th class="date"><label for="start_date">Start Date</label></th>'
+'<th class="date"><label for="end_date">End Date</label></th>'
+'<th><label for="sku">SKU</label></th>'
+'</tr>'
+'<tr>'
+'<td><input type="text" name="product_name'+i+'" value="" id="product_name'+i+'"></td>'
+'<td><input type="radio" name="region'+i+'" value="upper_north" id="upper_north'+i+'"><label for="upper_north'+i+'">Upper North Island</label><br />'
+'<input type="radio" name="region'+i+'" value="lower_north" id="lower_north'+i+'"><label for="lower_north'+i+'">Lower North Island</label><br />'
+'<input type="radio" name="region'+i+'" value="south_island" id="south_island"><label for="south_island">South Island</label> </td>'
+'<td class="date"><input type="text" class="date" name="start_date'+i+'" value="" id="start_date'+i+'"></td>'
+'<td class="date"><input type="text" class="date" name="end_date'+i+'" value="" id="end_date'+i+'"></td>'
+'<td><input type="text" name="sku'+i+'" value="" id="sku'+i+'"></td>'
+'</tr>'
+'</table>'
+''
+'<span class="product"></span>');
});
</script>
好吧,酷,這樣的產品的對象模型。 Thankyou,這在事情的這一方面確實有幫助。 – mdskinner 2010-02-19 00:51:44
@mdskinner祝你好運! :) – anthares 2010-02-19 00:59:25