- 注册时间
- 2012-5-4
- 最后登录
- 2013-5-30
- 阅读权限
- 10
- 积分
- 104
- 精华
- 0
- 帖子
- 36
|
本帖最后由 athrun 于 2012-6-8 08:02 编辑
niko 发表于 2012-6-7 16:29
能否把出问题的示例(HTML+JS)一并发上来。
这样可以快速重现问题。 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Demo</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="imagetoolbar" content="no" />
- <meta http-equiv="X-UA-Compatible" content="IE=8" />
- <meta http-equiv="MSThemeCompatible" content="no" />
- <meta name="MSSmartTagsPreventParsing" content="yes" />
- <meta name="description" content="Demo" />
- <meta name="keywords" content="Demo" />
- <meta name="copyright" content="Demo" />
- <meta name="author" content="Demo" />
- <!--meta http-equiv="Page-Enter" content="revealTrans(duration=1, transition=23)" /-->
- <!--网页进入的特效-->
- <!--meta http-equiv="Page-Exit" content="revealTrans(duration=1, transition=23)"-->
- <!--网页退出的特效-->
- <link href="images/style.css" rel="stylesheet" type="text/css" />
- <link href="scripts/miniui/themes/default/skin.css?version=2.0.6" rel="stylesheet" type="text/css" />
- <link href="scripts/miniui/themes/icons.css?version=2.0.6" rel="stylesheet" type="text/css" />
- <script src="scripts/jquery.js?version=1.6.2" type="text/javascript"></script>
- <script src="scripts/miniui/miniui.js?version=2.0.6" type="text/javascript"></script>
- <script src="scripts/jquery.cookie.js?version=1.6.2" type="text/javascript"></script>
- <script src="scripts/function.js" type="text/javascript"></script>
- <script src="scripts/ajax.js" type="text/javascript"></script>
- </head>
- <body>
- <script type="text/javascript">
- </script>
- <!--页面内容开始-->
- <form id="form1" name="form1" method="post">
- <div>
- <table>
- <tbody>
- <tr>
- <td width="60"><label for="ProductCategoryPCN$text">商品类别:</label></td>
- <td>
- <div id="ProductCategoryPCN" name="ProductCategoryPCN" class="mini-combobox" style="width:190px;" popupWidth="200" textField="text" valueField="id"
- url="productcategory.php?act=comboboxPCNName" value="" multiSelect="false" onvaluechanged="onValueChangedProductCategoryPCN" >
- <div property="columns">
- <div header="编号" field="id" width="50"></div>
- <div header="中文名称" field="text"></div>
- </div>
- </div>
- </td>
- </tr>
- <tr>
- <td width="60">商品编号:</td>
- <td><input name="PN" id="PN" class="mini-textbox" required="true" onvalidation="onPNValidation" onvaluechanged="onPNValueChanged" maxlength="6" style="width:190px;" value="" vtype="maxLength:6" /></td>
- </tr>
- <tr>
- <td width="60">单位:</td>
- <td><input id="Unit" name="Unit" class="mini-combobox" style="width:190px;" textField="text" valueField="id"
- url="product.php?act=autoCompleteUnit" value="" showNullItem="false" allowInput="true" required="true" /></td>
- </tr>
- <tr>
- <td width="60"><label for="Name$text">中文名称:</label></td>
- <td width="200"><input name="Name" id="Name" class="mini-textbox" required="true" maxlength="100" style="width:190px;" value="" /></td>
- </tr>
- <tr>
- <td width="60">英文名称:</td>
- <td><input name="NameEn" id="NameEn" class="mini-textbox" required="true" maxlength="100" style="width:190px;" value="" /></td>
- </tr>
- <tr>
- <td width="60"><label for="ArticleNo$text">中文型号:</label></td>
- <td width="200"><input name="ArticleNo" id="ArticleNo" class="mini-textbox" required="false" maxlength="100" style="width:190px;" value="" /></td>
- </tr>
- <tr>
- <td width="60">英文型号:</td>
- <td><input name="ArticleNoEn" id="ArticleNoEn" class="mini-textbox" required="false" maxlength="100" style="width:190px;" value="" /></td>
- </tr>
- <tr>
- <td width="60"><label for="Description$text">中文描述:</label></td>
- <td><input name="Description" id="Description" class="mini-textarea" required="false" maxlength="200" style="width:360px;" value="" /></td>
- </tr>
- <tr>
- <td width="60"><label for="DescriptionEn$text">英文描述:</label></td>
- <td><input name="DescriptionEn" id="DescriptionEn" class="mini-textarea" required="false" maxlength="200" style="width:360px;" value="" /></td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <td colspan="2" align="center">
- <input name="Flag" id="Flag" class="mini-hidden" value="0" type="hidden" />
- <a class="mini-button" iconCls="icon-ok" onclick="Submit">储存</a>
- <a class="mini-button" iconCls="icon-cancel" onclick="Cancel">取消</a> </td>
- </tr>
- </tfoot>
- </table>
- </div>
- </form>
- <!--页面内容结束-->
- <script type="text/javascript">
- </script>
- <script type="text/javascript">
- <!--
- var form;
- jQuery(document).ready(function() {
- init();
- });
- function init(){
- form = new mini.Form("form1");
- if(mini.get("Flag").getFormValue()=='1'){
- mini.get("ProductCategoryPCN").disable();
- mini.get("PN").disable();
- }
- }
- function SubmitData() {
- LoginCheck();
- form.validate();
- if (form.isValid() == false) return false;
- var Unit = mini.get("Unit").getText();
- var o = form.getData(true);
- o.Unit = Unit;
- var json = mini.encode(o);
- $.ajax({
- url: "product.php?act=save",
- type:"POST",
- data: { json: json },
- cache: false,
- success: function (text) {
- if(text=='1'){
- if(mini.get("Flag").getFormValue()=='0'){
- CloseWindow("save");
- }else{
- window.parent.reloadTab();
- }
- }else{
- AjaxErrorMsg(text);
- }
- },
- error: function (jqXHR, textStatus, errorThrown) {
- AjaxErrorMsg(jqXHR.responseText);
- CloseWindow();
- }
- });
- }
- function Submit(e) {
- SubmitData();
- }
- function Cancel(e) {
- CloseWindow("cancel");
- }
- function onPNValueChanged(e){
- mini.get("PN").setValue(e.value.toUpperCase());
- }
- function onPNValidation(e){
- if (e.isValid) {
- if(mini.get("Flag").getFormValue()=='0'){
- if (PNExists(e.value) == false) {
- e.errorText = "编号已经存在";
- e.isValid = false;
- }
- }
- }
- }
- function PNExists(PN){
- var Result = false;
- $.ajax({
- url: "product.php?act=pn_exists",
- type: "get",
- async: false,
- data: {
- PN:PN
- },
- success: function (text) {
- Result=(text=="0")?true:false;
- }
- });
- return Result;
- }
- function onValueChangedProductCategoryPCN(e) {
- var item = e.selected;
- if (item) {
- var obj=mini.get("ProductCategoryPCN");
- ReplacePNFirstChar(item.id);
- }
- }
- function ReplacePNFirstChar(PCN){
- var obj=mini.get("PN");
- var v = obj.getFormValue();
- if(v==''){
- obj.setValue(PCN);
- }else{
- obj.setValue(PCN+v.substr(1));
- }
- }
- -->
- </script>
- </body></html>
复制代码
|
|