Alert user when not specied length for CHAR/VARCHAR fields.
This commit is contained in:
@@ -7,6 +7,8 @@ $Source$
|
||||
|
||||
2003-06-25 Michal Cihar <nijel@users.sourceforge.net>
|
||||
* libraries/sqlparser.lib.php3: Fixed XSS problem.
|
||||
* tbl_properties.inc.php3, libraries/functions.js: Alert user when not
|
||||
specied length for CHAR/VARCHAR fields.
|
||||
|
||||
2003-06-24 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* sql.php3, bug 759568, row count, DISTINCT and MySQL 4
|
||||
|
@@ -246,6 +246,25 @@ function checkFormElementInRange(theForm, theFieldName, min, max)
|
||||
return true;
|
||||
} // end of the 'checkFormElementInRange()' function
|
||||
|
||||
function checkTableEditForm(theForm, fieldsCnt)
|
||||
{
|
||||
for (i=0; i<fieldsCnt; i++)
|
||||
{
|
||||
var id = "field_" + i + "_2";
|
||||
var elm = getElement(id);
|
||||
if (elm.value == 'VARCHAR' || elm.value == 'CHAR') {
|
||||
elm2 = getElement("field_" + i + "_3")
|
||||
val = parseInt(elm2.value);
|
||||
if (isNaN(val)) {
|
||||
elm2.select();
|
||||
alert(errorMsg1);
|
||||
elm2.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // enf of the 'checkTableEditForm()' function
|
||||
|
||||
|
||||
/**
|
||||
* Ensures the choice between 'transmit', 'zipped', 'gzipped' and 'bzipped'
|
||||
|
@@ -18,7 +18,7 @@ document.onkeydown = onKeyDownArrowsHandler;
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
<form method="post" action="<?php echo $action; ?>">
|
||||
<form method="post" action="<?php echo $action; ?>" onsubmit="checkTableEditForm(this, <?php echo $num_fields; ?>)" >
|
||||
<?php
|
||||
echo PMA_generate_common_hidden_inputs($db, $table);
|
||||
if ($action == 'tbl_create.php3') {
|
||||
|
Reference in New Issue
Block a user