daeyure Posted January 13, 2012 Report Share Posted January 13, 2012 Olá pessoal, tudo bem?Sempre que encontro um problema venho direto pra esse site, sempre vocês dão um jeito....rs.Estou com problema em um formulário, queria fazer um datepicker com calendario pop-up. Fiz os passos pelo developer toolbox e encontrei um problema:calendar.setup:Nothing to setup (no fields found). Please check your codeQuando entro na página do formulário, me apresenta esse erro em pop-up. Aí eu clico em OK, ele carrega tudo normalmente e funciona que é uma beleza...Mas não quero que fique toda hora tendo que clicar em OK, queria resolver isso, mas não acho onde no código.Será que alguém pode me ajudar?Segue o código:<?php require_once('Connections/contas.php'); ?> <?php //MX Widgets3 include require_once('includes/wdg/WDG.php'); // Load the common classes require_once('includes/common/KT_common.php'); // Load the tNG classes require_once('includes/tng/tNG.inc.php'); // Load the KT_back class require_once('includes/nxt/KT_back.php'); // Make a transaction dispatcher instance $tNGs = new tNG_dispatcher(""); // Make unified connection variable $conn_contas = new KT_connection($contas, $database_contas); // Start trigger $formValidation = new tNG_FormValidation(); $formValidation->addField("Empresa", true, "text", "", "", "", "Por favor, insira o nome da empresa."); $formValidation->addField("Data_Vencimento", true, "date", "date", "", "", "Por favor insira a data de vencimento."); $formValidation->addField("Valor", true, "numeric", "int_positive", "", "", "Por favor insira um valor."); $formValidation->addField("Descricao", true, "text", "", "", "", "Por favor, insira uma descrição."); $formValidation->addField("Situacao", true, "text", "", "", "", "PAGO ou NÃO PAGO"); $tNGs->prepareValidation($formValidation); // End trigger // Make an insert transaction instance $ins_contas = new tNG_multipleInsert($conn_contas); $tNGs->addTransaction($ins_contas); // Register triggers $ins_contas->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1"); $ins_contas->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $ins_contas->registerTrigger("END", "Trigger_Default_Redirect", 99, "includes/nxt/back.php"); // Add columns $ins_contas->setTable("contas"); $ins_contas->addColumn("Empresa", "STRING_TYPE", "POST", "Empresa"); $ins_contas->addColumn("Data_Vencimento", "DATE_TYPE", "POST", "Data_Vencimento"); $ins_contas->addColumn("Valor", "NUMERIC_TYPE", "POST", "Valor"); $ins_contas->addColumn("Descricao", "STRING_TYPE", "POST", "Descricao"); $ins_contas->addColumn("Situacao", "STRING_TYPE", "POST", "Situacao"); $ins_contas->setPrimaryKey("id_doc", "NUMERIC_TYPE"); // Make an update transaction instance $upd_contas = new tNG_multipleUpdate($conn_contas); $tNGs->addTransaction($upd_contas); // Register triggers $upd_contas->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1"); $upd_contas->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $upd_contas->registerTrigger("END", "Trigger_Default_Redirect", 99, "includes/nxt/back.php"); // Add columns $upd_contas->setTable("contas"); $upd_contas->addColumn("Empresa", "STRING_TYPE", "POST", "Empresa"); $upd_contas->addColumn("Data_Vencimento", "DATE_TYPE", "POST", "Data_Vencimento"); $upd_contas->addColumn("Valor", "NUMERIC_TYPE", "POST", "Valor"); $upd_contas->addColumn("Descricao", "STRING_TYPE", "POST", "Descricao"); $upd_contas->addColumn("Situacao", "STRING_TYPE", "POST", "Situacao"); $upd_contas->setPrimaryKey("id_doc", "NUMERIC_TYPE", "GET", "id_doc"); // Make an instance of the transaction object $del_contas = new tNG_multipleDelete($conn_contas); $tNGs->addTransaction($del_contas); // Register triggers $del_contas->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Delete1"); $del_contas->registerTrigger("END", "Trigger_Default_Redirect", 99, "includes/nxt/back.php"); // Add columns $del_contas->setTable("contas"); $del_contas->setPrimaryKey("id_doc", "NUMERIC_TYPE", "GET", "id_doc"); // Execute all the registered transactions $tNGs->executeTransactions(); // Get the transaction recordset $rscontas = $tNGs->getRecordset("contas"); $row_rscontas = mysql_fetch_assoc($rscontas); $totalRows_rscontas = mysql_num_rows($rscontas); ?> <!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" xmlns:wdg="http://ns.adobe.com/addt"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>.:: Inserir contas a pagar ::.</title> <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" /> <script src="includes/common/js/base.js" type="text/javascript"></script> <script src="includes/common/js/utility.js" type="text/javascript"></script> <script src="includes/skins/style.js" type="text/javascript"></script> <?php echo $tNGs->displayValidationRules();?> <script src="includes/nxt/scripts/form.js" type="text/javascript"></script> <script src="includes/nxt/scripts/form.js.php" type="text/javascript"></script> <script type="text/javascript"> $NXT_FORM_SETTINGS = { duplicate_buttons: true, show_as_grid: true, merge_down_value: true } </script> <script type="text/javascript" src="includes/common/js/sigslot_core.js"></script> <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js"></script> <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js.php"></script> <script type="text/javascript" src="includes/wdg/classes/Calendar.js"></script> <script type="text/javascript" src="includes/wdg/classes/SmartDate.js"></script> <script type="text/javascript" src="includes/wdg/calendar/calendar_stripped.js"></script> <script type="text/javascript" src="includes/wdg/calendar/calendar-setup_stripped.js"></script> <script src="includes/resources/calendar.js"></script> </head> <body> <?php echo $tNGs->getErrorMsg(); ?> <div class="KT_tng"> <h1> Inserir contas a pagar.</h1> <div class="KT_tngform"> <form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>"> <?php $cnt1 = 0; ?> <?php do { ?> <?php $cnt1++; ?> <?php // Show IF Conditional region1 if (@$totalRows_rscontas > 1) { ?> <h2><?php echo NXT_getResource("Record_FH"); ?> <?php echo $cnt1; ?></h2> <?php } // endif Conditional region1 ?> <table cellpadding="2" cellspacing="0" class="KT_tngtable"> <tr> <td class="KT_th"><label for="Empresa_<?php echo $cnt1; ?>">Empresa:</label></td> <td><input type="text" name="Empresa_<?php echo $cnt1; ?>" id="Empresa_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rscontas['Empresa']); ?>" size="32" maxlength="100" /> <?php echo $tNGs->displayFieldHint("Empresa");?> <?php echo $tNGs->displayFieldError("contas", "Empresa", $cnt1); ?></td> </tr> <tr><script type="text/javascript"> Calendar.setup( { inputField : "data", // ID of the input field ifFormat : "%m %d, %Y", // the date format button : "trigger" // ID of the button } ); </script> <td class="KT_th"><label for="Data_Vencimento_<?php echo $cnt1; ?>">Data de Vencimento:</label></td> <td><input name="Data_Vencimento_<?php echo $cnt1; ?>" id="Data_Vencimento_<?php echo $cnt1; ?>" value="<?php echo KT_formatDate($row_rscontas['Data_Vencimento']); ?>" size="10" maxlength="10" wdg:mondayfirst="false" wdg:subtype="Calendar" wdg:mask="<?php echo $KT_screen_date_format; ?>" wdg:type="widget" wdg:singleclick="false" wdg:restricttomask="no" wdg:readonly="true" /> <?php echo $tNGs->displayFieldHint("Data_Vencimento");?> <?php echo $tNGs->displayFieldError("contas", "Data_Vencimento", $cnt1); ?></td> </tr> <tr> <td class="KT_th"><label for="Valor_<?php echo $cnt1; ?>">Valor:</label></td> <td><input type="text" name="Valor_<?php echo $cnt1; ?>" id="Valor_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rscontas['Valor']); ?>" size="7" maxlength="7" /> <?php echo $tNGs->displayFieldHint("Valor");?> <?php echo $tNGs->displayFieldError("contas", "Valor", $cnt1); ?></td> </tr> <tr> <td class="KT_th"><label for="Descricao_<?php echo $cnt1; ?>">Descricao:</label></td> <td><input type="text" name="Descricao_<?php echo $cnt1; ?>" id="Descricao_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rscontas['Descricao']); ?>" size="32" /> <?php echo $tNGs->displayFieldHint("Descricao");?> <?php echo $tNGs->displayFieldError("contas", "Descricao", $cnt1); ?></td> </tr> <tr> <td class="KT_th"><label for="Situacao_<?php echo $cnt1; ?>">Situacao:</label></td> <td><input type="text" name="Situacao_<?php echo $cnt1; ?>" id="Situacao_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rscontas['Situacao']); ?>" size="8" maxlength="8" /> <?php echo $tNGs->displayFieldHint("Situacao");?> <?php echo $tNGs->displayFieldError("contas", "Situacao", $cnt1); ?></td> </tr> </table> <input type="hidden" name="kt_pk_contas_<?php echo $cnt1; ?>" class="id_field" value="<?php echo KT_escapeAttribute($row_rscontas['kt_pk_contas']); ?>" /> <?php } while ($row_rscontas = mysql_fetch_assoc($rscontas)); ?> <div class="KT_bottombuttons"> <div> <?php // Show IF Conditional region1 if (@$_GET['id_doc'] == "") { ?> <input type="submit" name="KT_Insert1" id="KT_Insert1" value="<?php echo NXT_getResource("Insert_FB"); ?>" /> <?php // else Conditional region1 } else { ?> <div class="KT_operations"> <input type="submit" name="KT_Insert1" value="<?php echo NXT_getResource("Insert as new_FB"); ?>" onclick="nxt_form_insertasnew(this, 'id_doc')" /> </div> <input type="submit" name="KT_Update1" value="<?php echo NXT_getResource("Update_FB"); ?>" /> <input type="submit" name="KT_Delete1" value="<?php echo NXT_getResource("Delete_FB"); ?>" onclick="return confirm('<?php echo NXT_getResource("Are you sure?"); ?>');" /> <?php } // endif Conditional region1 ?> <input type="button" name="KT_Cancel1" value="<?php echo NXT_getResource("Cancel_FB"); ?>" onclick="return UNI_navigateCancel(event, 'includes/nxt/back.php')" /> </div> </div> </form> </div> <br class="clearfixplain" /> </div> <p> </p> </body> </html>Abraços desde já galera....Yuri Quote Link to comment Share on other sites More sharing options...
0 daeyure Posted January 13, 2012 Author Report Share Posted January 13, 2012 vlw, já consegui, pode fechar. Quote Link to comment Share on other sites More sharing options...
0 Willian Gustavo Veiga Posted January 20, 2012 Report Share Posted January 20, 2012 E qual foi a solução? Pode ser útil para outras pessoas.Um abraço. Quote Link to comment Share on other sites More sharing options...
Question
daeyure
Olá pessoal, tudo bem?
Sempre que encontro um problema venho direto pra esse site, sempre vocês dão um jeito....rs.
Estou com problema em um formulário, queria fazer um datepicker com calendario pop-up. Fiz os passos pelo developer toolbox e encontrei um problema:
calendar.setup:
Nothing to setup (no fields found). Please check your code
Quando entro na página do formulário, me apresenta esse erro em pop-up. Aí eu clico em OK, ele carrega tudo normalmente e funciona que é uma beleza...
Mas não quero que fique toda hora tendo que clicar em OK, queria resolver isso, mas não acho onde no código.
Será que alguém pode me ajudar?
Segue o código:
Abraços desde já galera....
Yuri
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.