从jquery.ui对话框中的条目访问文本

时间:2011-11-22 23:30:00

标签: forms text jquery-ui-dialog

如何从jquery.ui对话框中获取文本数据? 我已经挑出了不起作用的电话,并且包含了所有脚本链接以显示我正在使用的内容。虽然对话框中的文本输入有效,但它不会传递给包含它的表单。如您所见,我试图将其复制到对话框外的字段,但这不起作用。我真正想要做的是将其发布到操作页面,就像表单中的其他数据一样。

以下是网址:http://dev.bizzocall.com/cp-BizzoActiveButtonSIMPLE.php

CODE:

<?php require_once('Connections/bizCon.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
mysql_select_db($database_bizCon, $bizCon);
$query_buttonPrefsSet = "SELECT buttonprefs.iduserid, buttonprefs.btop, buttonprefs.bleft, buttonprefs.bcolor, buttonprefs.blabel, buttonprefs.newvisitors, buttonprefs.bdelay, buttonprefs.brepeats, buttonprefs.btype, buttonprefs.bphonetarget FROM buttonprefs ORDER BY buttonprefs.iduserid DESC LIMIT 1";
$buttonPrefsSet = mysql_query($query_buttonPrefsSet, $bizCon) or die(mysql_error());
$row_buttonPrefsSet = mysql_fetch_assoc($buttonPrefsSet);
$totalRows_buttonPrefsSet = mysql_num_rows($buttonPrefsSet);
?>
<!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">
<title>Bizzo Control Panel</title>
<link href="css/plan.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="css/BizzocallPopup.css" type="text/css"/>
<link href="css/cpanel.css" rel="stylesheet" type="text/css"/>
<link href="css/BizzocallPopup.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script src="Draggable/development-bundle/ui/jquery.ui.core.js"></script>
<script src="Draggable/development-bundle/ui/jquery.ui.widget.js"></script>
<script src="Draggable/development-bundle/ui/jquery.ui.mouse.js"></script>
<script src="Draggable/development-bundle/ui/jquery.ui.draggable.js"></script>
<link type="text/css" href="css/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript">
            $(function(){
                // Dialog           
                $('#labelStgdialog').dialog({
                    autoOpen: false,
                    width: 400,
                    buttons: {
                        "OK": function() { 

                            $(this).dialog("close"); 
                        } 
                    }
                });

                // Dialog Link
                $('#labelSetgbtn').click(function(){
                    $('#labelStgdialog').dialog('open');
                    return false;
                });

            });

            $('#enterlabel').change(function() {
             $("input#blabel").val($("input#enterlabel;").val());
});
        </script>
</head>
<body>
<div class="contentWrapper">
  <form action="cp-BizzoEmbedCodeSIMPLE.php" method="post" enctype="multipart/form-data" name="buttonprefform" target="_top">
    <div id="labelSetgbtn" class="button gray LabelSettings"><a href="#">LABEL SETTINGS</a></div>
    <div id="labelStgdialog" class="DialogBox">
      <div class="boldtxt">ENTER YOUR CUSTOM LABEL</div>
      <div class="labeltxtblack">CALL&nbsp;&nbsp;&nbsp;</div>
      <input name="enterlabel" type="text" id="enterlabel" class="enterlabel" value=" > 10 char "  maxlength="9" length="10"/>
      <div class="clearer"></div>
      <div class="space10"></div>
      <div class="bcpopuptop">
        <div class="bcsquare">
          <div class="innersquare"></div>
        </div>
        <div class="btnlabeltxt">CALL NOW</div>
      </div>
    </div>
    <input id="blabel" name="blabel" type="text" value="<?php echo strtoupper($row_buttonPrefsSet['blabel']); ?>" />
    <button name="mysubmitbutton" id="mysubmitbutton" type="submit" class="createbizzobutton"> </button>
  </form>
</div>
<!--END contentwrapper-->
</body>
</html>

1 个答案:

答案 0 :(得分:0)

这一行

$(&#34;输入#blabel&#34)。VAL($(&#34;输入#enterlabel;&#34;)VAL());

应该是

$(&#34;输入#blabel&#34)。VAL($(&#34;输入#enterlabel&#34;)VAL());