par
murdok » 26 févr. 2009, 13:58
Bonjour à tous,
j'ai remplacé dans un formulaire un textarea par FCKEDITOR.
les données s'affiche bien dedans lorsque j'édite une donnée mais pas contre pas lors de la saisie d'une nouvelle donnée ou l'édition j'ai un retour : Column 'comment_redac' cannot be null.
<?php require_once('../Connections/connectionbdd.php');
include_once("fckeditor/fckeditor.php") ;?>
<?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_connectionbdd = new KT_connection($connectionbdd, $database_connectionbdd);
// Start trigger
$formValidation = new tNG_FormValidation();
$tNGs->prepareValidation($formValidation);
// End trigger
// Make an insert transaction instance
$ins_redac = new tNG_multipleInsert($conn_connectionbdd);
$tNGs->addTransaction($ins_redac);
// Register triggers
$ins_redac->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
$ins_redac->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$ins_redac->registerTrigger("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.php");
// Add columns
$ins_redac->setTable("redac");
$ins_redac->addColumn("subject_redac", "STRING_TYPE", "POST", "subject_redac");
$ins_redac->addColumn("comment_redac", "STRING_TYPE", "POST", $var1);
$ins_redac->addColumn("image_redac", "FILE_TYPE", "FILES", "image_redac");
$ins_redac->setPrimaryKey("id_redac", "NUMERIC_TYPE");
// Make an update transaction instance
$upd_redac = new tNG_multipleUpdate($conn_connectionbdd);
$tNGs->addTransaction($upd_redac);
// Register triggers
$upd_redac->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
$upd_redac->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$upd_redac->registerTrigger("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.php");
// Add columns
$upd_redac->setTable("redac");
$upd_redac->addColumn("subject_redac", "STRING_TYPE", "POST", "subject_redac");
$upd_redac->addColumn("comment_redac", "STRING_TYPE", "POST", "comment_redac");
$upd_redac->addColumn("image_redac", "FILE_TYPE", "FILES", "image_redac");
$upd_redac->setPrimaryKey("id_redac", "NUMERIC_TYPE", "GET", "id_redac");
// Make an instance of the transaction object
$del_redac = new tNG_multipleDelete($conn_connectionbdd);
$tNGs->addTransaction($del_redac);
// Register triggers
$del_redac->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Delete1");
$del_redac->registerTrigger("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.php");
// Add columns
$del_redac->setTable("redac");
$del_redac->setPrimaryKey("id_redac", "NUMERIC_TYPE", "GET", "id_redac");
// Execute all the registered transactions
$tNGs->executeTransactions();
// Get the transaction recordset
$rsredac = $tNGs->getRecordset("redac");
$row_rsredac = mysql_fetch_assoc($rsredac);
$totalRows_rsredac = mysql_num_rows($rsredac);
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans titre</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: false,
show_as_grid: true,
merge_down_value: true
}
</script>
</head>
<body>
<?php
echo $tNGs->getErrorMsg();
?>
<div class="KT_tng">
<h1>
<?php
// Show IF Conditional region1
if (@$_GET['id_redac'] == "") {
?>
<?php echo NXT_getResource("Insert_FH"); ?>
<?php
// else Conditional region1
} else { ?>
<?php echo NXT_getResource("Update_FH"); ?>
<?php }
// endif Conditional region1
?>
Redac </h1>
<div class="KT_tngform">
<form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" enctype="multipart/form-data">
<?php $cnt1 = 0; ?>
<?php do { ?>
<?php $cnt1++; ?>
<?php
// Show IF Conditional region1
if (@$totalRows_rsredac > 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="subject_redac_<?php echo $cnt1; ?>">Subject_redac:</label></td>
<td><input type="text" name="subject_redac_<?php echo $cnt1; ?>" id="subject_redac_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rsredac['subject_redac']); ?>" size="32" maxlength="40" />
<?php echo $tNGs->displayFieldHint("subject_redac");?> <?php echo $tNGs->displayFieldError("redac", "subject_redac", $cnt1); ?> </td>
</tr>
<tr>
<td class="KT_th"><label for="comment_redac_<?php echo $cnt1; ?>">Comment_redac:</label></td>
<td width="600"> <?php
$var1 = $row_rsredac['comment_redac'] ;
$oFCKeditor = new FCKeditor('comment_redac') ;
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->ToolbarSet = 'Basic';
$oFCKeditor->Width='100%';
$oFCKeditor->Value = $row_rsredac['comment_redac'] ;
$oFCKeditor->Create() ;
?>
<input type="hidden" name="comment_redac_<?php echo $cnt1; ?>" id="comment_redac_<?php echo $cnt1; ?>" value="<?php echo $var1; ?>" size="32" />
<?php echo $tNGs->displayFieldHint("comment_redac");?> <?php echo $tNGs->displayFieldError("redac", "comment_redac", $cnt1); ?> </td>
</tr>
<tr>
<td class="KT_th"><label for="image_redac_<?php echo $cnt1; ?>">Image_redac:</label></td>
<td>
<input type="text" name="image_redac_<?php echo $cnt1; ?>" id="image_redac_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rsredac['image_redac']); ?>" size="32" maxlength="50" />
<?php echo $tNGs->displayFieldHint("image_redac");?> <?php echo $tNGs->displayFieldError("redac", "image_redac", $cnt1); ?> </td>
</tr>
</table>
<input type="hidden" name="kt_pk_redac_<?php echo $cnt1; ?>" class="id_field" value="<?php echo KT_escapeAttribute($row_rsredac['kt_pk_redac']); ?>" />
<?php } while ($row_rsredac = mysql_fetch_assoc($rsredac)); ?>
<div class="KT_bottombuttons">
<div>
<?php
// Show IF Conditional region1
if (@$_GET['id_redac'] == "") {
?>
<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_redac')" />
</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>
merci
Bonjour à tous,
j'ai remplacé dans un formulaire un textarea par FCKEDITOR.
les données s'affiche bien dedans lorsque j'édite une donnée mais pas contre pas lors de la saisie d'une nouvelle donnée ou l'édition j'ai un retour : Column 'comment_redac' cannot be null.
[php]<?php require_once('../Connections/connectionbdd.php');
include_once("fckeditor/fckeditor.php") ;?>
<?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_connectionbdd = new KT_connection($connectionbdd, $database_connectionbdd);
// Start trigger
$formValidation = new tNG_FormValidation();
$tNGs->prepareValidation($formValidation);
// End trigger
// Make an insert transaction instance
$ins_redac = new tNG_multipleInsert($conn_connectionbdd);
$tNGs->addTransaction($ins_redac);
// Register triggers
$ins_redac->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
$ins_redac->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$ins_redac->registerTrigger("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.php");
// Add columns
$ins_redac->setTable("redac");
$ins_redac->addColumn("subject_redac", "STRING_TYPE", "POST", "subject_redac");
$ins_redac->addColumn("comment_redac", "STRING_TYPE", "POST", $var1);
$ins_redac->addColumn("image_redac", "FILE_TYPE", "FILES", "image_redac");
$ins_redac->setPrimaryKey("id_redac", "NUMERIC_TYPE");
// Make an update transaction instance
$upd_redac = new tNG_multipleUpdate($conn_connectionbdd);
$tNGs->addTransaction($upd_redac);
// Register triggers
$upd_redac->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1");
$upd_redac->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$upd_redac->registerTrigger("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.php");
// Add columns
$upd_redac->setTable("redac");
$upd_redac->addColumn("subject_redac", "STRING_TYPE", "POST", "subject_redac");
$upd_redac->addColumn("comment_redac", "STRING_TYPE", "POST", "comment_redac");
$upd_redac->addColumn("image_redac", "FILE_TYPE", "FILES", "image_redac");
$upd_redac->setPrimaryKey("id_redac", "NUMERIC_TYPE", "GET", "id_redac");
// Make an instance of the transaction object
$del_redac = new tNG_multipleDelete($conn_connectionbdd);
$tNGs->addTransaction($del_redac);
// Register triggers
$del_redac->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Delete1");
$del_redac->registerTrigger("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.php");
// Add columns
$del_redac->setTable("redac");
$del_redac->setPrimaryKey("id_redac", "NUMERIC_TYPE", "GET", "id_redac");
// Execute all the registered transactions
$tNGs->executeTransactions();
// Get the transaction recordset
$rsredac = $tNGs->getRecordset("redac");
$row_rsredac = mysql_fetch_assoc($rsredac);
$totalRows_rsredac = mysql_num_rows($rsredac);
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans titre</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: false,
show_as_grid: true,
merge_down_value: true
}
</script>
</head>
<body>
<?php
echo $tNGs->getErrorMsg();
?>
<div class="KT_tng">
<h1>
<?php
// Show IF Conditional region1
if (@$_GET['id_redac'] == "") {
?>
<?php echo NXT_getResource("Insert_FH"); ?>
<?php
// else Conditional region1
} else { ?>
<?php echo NXT_getResource("Update_FH"); ?>
<?php }
// endif Conditional region1
?>
Redac </h1>
<div class="KT_tngform">
<form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" enctype="multipart/form-data">
<?php $cnt1 = 0; ?>
<?php do { ?>
<?php $cnt1++; ?>
<?php
// Show IF Conditional region1
if (@$totalRows_rsredac > 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="subject_redac_<?php echo $cnt1; ?>">Subject_redac:</label></td>
<td><input type="text" name="subject_redac_<?php echo $cnt1; ?>" id="subject_redac_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rsredac['subject_redac']); ?>" size="32" maxlength="40" />
<?php echo $tNGs->displayFieldHint("subject_redac");?> <?php echo $tNGs->displayFieldError("redac", "subject_redac", $cnt1); ?> </td>
</tr>
<tr>
<td class="KT_th"><label for="comment_redac_<?php echo $cnt1; ?>">Comment_redac:</label></td>
<td width="600"> <?php
$var1 = $row_rsredac['comment_redac'] ;
$oFCKeditor = new FCKeditor('comment_redac') ;
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->ToolbarSet = 'Basic';
$oFCKeditor->Width='100%';
$oFCKeditor->Value = $row_rsredac['comment_redac'] ;
$oFCKeditor->Create() ;
?>
<input type="hidden" name="comment_redac_<?php echo $cnt1; ?>" id="comment_redac_<?php echo $cnt1; ?>" value="<?php echo $var1; ?>" size="32" />
<?php echo $tNGs->displayFieldHint("comment_redac");?> <?php echo $tNGs->displayFieldError("redac", "comment_redac", $cnt1); ?> </td>
</tr>
<tr>
<td class="KT_th"><label for="image_redac_<?php echo $cnt1; ?>">Image_redac:</label></td>
<td>
<input type="text" name="image_redac_<?php echo $cnt1; ?>" id="image_redac_<?php echo $cnt1; ?>" value="<?php echo KT_escapeAttribute($row_rsredac['image_redac']); ?>" size="32" maxlength="50" />
<?php echo $tNGs->displayFieldHint("image_redac");?> <?php echo $tNGs->displayFieldError("redac", "image_redac", $cnt1); ?> </td>
</tr>
</table>
<input type="hidden" name="kt_pk_redac_<?php echo $cnt1; ?>" class="id_field" value="<?php echo KT_escapeAttribute($row_rsredac['kt_pk_redac']); ?>" />
<?php } while ($row_rsredac = mysql_fetch_assoc($rsredac)); ?>
<div class="KT_bottombuttons">
<div>
<?php
// Show IF Conditional region1
if (@$_GET['id_redac'] == "") {
?>
<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_redac')" />
</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>
[/php]
merci