private void RegisterClientScript()
{
string script = @"
function updateTextOrDdlValue( e ) {
var $row = e.closest('div.js-text-or-ddl-row');
var newValue = $row.find('input.js-text-or-ddl-input:first').val();
if (!newValue || newValue == '' ) {
newValue = $row.find('textarea.js-text-or-ddl-input:first').val();
}
if (!newValue || newValue == '' ) {
newValue = $row.find('select.js-text-or-ddl-input:first').val();
}
$row.find('input:first').val(newValue);
}
$(document).on('focusout', '.js-text-or-ddl-input', function (e) {
updateTextOrDdlValue($(this));
});
";
ScriptManager.RegisterStartupScript( this, this.GetType(), "text-or-ddl", script, true );
}