From eec80b2a1fd7ef5283b2e8ed4665d02d007b4414 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 30 Apr 2011 14:56:02 -0400 Subject: [PATCH] Bug #3291923, Insert Ajax form does not generate default values - partial fix for text fields --- js/tbl_change.js | 2 +- tbl_change.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/js/tbl_change.js b/js/tbl_change.js index 896700bb6..8fc7eca33 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -387,7 +387,7 @@ $(document).ready(function() { if ($this_element.is('.textfield')) { // do not remove the 'value' attribute for ENUM columns if ($this_element.closest('tr').find('span.column_type').html() != 'enum') { - $this_element.attr('value', ''); + $this_element.attr('value', $this_element.closest('tr').find('span.default_value').html()); } $this_element .unbind('change') diff --git a/tbl_change.php b/tbl_change.php index 1b6a2b69d..22584db43 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -694,6 +694,9 @@ foreach ($rows as $row_id => $vrow) { // HTML attribute echo ' ' . "\n"; + // Will be used by js/tbl_change.js to set the default value + // for the "Continue insertion" feature + echo '' . $special_chars . ''; if ($foreignData['foreign_link'] == true) { echo $backup_field . "\n"; ?>