اول ممنون از شما که وقت میزارید و جواب من رو میدید من کل کد صفحم رو میزارم خودتون ببینید و تغییرات بدید میخام فیلد price رو وقتی انتخاب شد و وقتی فیلد tedad درونش پر شد بدون رفرش در فیلد pricekol دو فیلد قبلی باهم صرب بشن و نتیجش در این فیلد نمایش داده بشه با تشکر
<?php
include_once('header.php');
include_once('topmenu.php');
include_once('logo.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("select#type").attr("disabled","disabled");
$("select#category").change(function(){
$("select#type").attr("disabled","disabled");
$("select#type").html("<option>wait...</option>");
var id = $("select#category option:selected").attr('value');
$.post("select_type.php", {id:id}, function(data){
$("select#type").removeAttr("disabled");
$("select#type").html(data);
});
});
$("form#select_form").submit(function(){
var cat = $("select#category option:selected").attr('value');
var type = $("select#type option:selected").attr('value');
if(cat>0 && type>0)
{
var result = $("select#type option:selected").html();
$("#result").html('your choice: '+result);
}
else
{
$("#result").html("you must choose two options!");
}
return false;
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$("select#price").attr("disabled","disabled");
$("select#type").change(function(){
$("select#price").attr("disabled","disabled");
$("select#price").html("<option>wait...</option>");
var id = $("select#type option:selected").attr('value');
$.post("select_type1.php", {id:id}, function(data){
$("select#price").removeAttr("disabled");
$("select#price").html(data);
});
});
$("form#select_form").submit(function(){
var cat = $("select#type option:selected").attr('value');
var type = $("select#price option:selected").attr('value');
if(cat>0 && type>0)
{
var result = $("select#price option:selected").html();
$("#result").html('your choice: '+result);
}
else
{
$("#result").html("you must choose two options!");
}
return false;
});
});
</script>
</head>
<body>
<div class="art-content-layout">
<div class="art-content-layout-row">
<div class="art-layout-cell art-content">
<div class="art-post">
<div class="art-post-tl"></div>
<div class="art-post-tr"></div>
<div class="art-post-bl"></div>
<div class="art-post-br"></div>
<div class="art-post-tc"></div>
<div class="art-post-bc"></div>
<div class="art-post-cl"></div>
<div class="art-post-cr"></div>
<div class="art-post-cc"></div>
<div class="art-post-body">
<div class="art-post-inner art-article">
<div class="art-postmetadataheader">
<h2 class="art-postheader">
<p align="center">فاکتور فروش </p>
</h2>
<div class="cleared"></div>
</div>
<div class="art-postcontent">
<?php if(!isset($_SESSION['userid'])) return false;?>
<?php include "select.class.php"; ?>
<pre>
<form id="select_form">
:شماره فاکتور
<input name="id_kala" type="text" /> <br />
:تاریخ
<input name="id_kala" type="text" /> <br />
:ساعت
<input name="id_kala" type="text" /> <br />
:کد اشتراک
<input name="id_kala" type="text" /> <br />
:وضعیت پرداخت
<input name="id_kala" type="text" /> <br />
:وضعیت سفارش
<input name="id_kala" type="text" /> <br />
:گروه کالا
<select id="category">
<?php echo $opt->ShowCategory(); ?>
</select>
<br />
:نام کالا
<select id="type">
<option value="0">choose...</option>
</select>
<br />
:قیمت
<select name="price" id="price">
<option value="0">choose...</option>
</select>
<br />
:تعداد
<input name="tedad" id="tedad" type="text" /> <br />
:قیمت کل
<input name="pricekol" id="pricekol" type="text" /> <br />
<input type="submit" value="ثبت" />
</form>
</pre>
<div id="result"></div>
</div>
<div class="cleared"></div>
</div>
<div class="cleared"></div>
</div>
</div>
</body>
</html>
<?php
include_once('sidebar.php');
include_once('userprofile_module.php');
include_once('payment_module.php');
include_once('footer.php');
?>