limit the number of characters displayed in the confirmation box

This commit is contained in:
Loïc Chapeaux
2001-09-11 09:27:47 +00:00
parent e34a463b3c
commit 9b839bf6f7

View File

@@ -71,7 +71,10 @@ function confirmQuery(theForm1, sqlQuery1)
if (do_confirm_re_0.test(sqlQuery1.value)
|| do_confirm_re_1.test(sqlQuery1.value)
|| do_confirm_re_2.test(sqlQuery1.value)) {
var is_confirmed = confirm(confirmMsg + ' :\n' + sqlQuery1.value);
var message = (sqlQuery1.value.length > 100)
? sqlQuery1.value.substr(0, 100) + '\n ...'
: sqlQuery1.value;
var is_confirmed = confirm(confirmMsg + ' :\n' + message);
// drop/delete/alter statement is confirmed -> update the
// "is_js_confirmed" form field so the confirm test won't be
// run on the server side and allows to submit the form