Hi
I have a field on a form which is disabled (as I want a certain form and style of text placed in there) - when the user presses a button, they get a popup box and they type in there. When they press OK that text gets written back to the field and some audit text is placed in there also. This works well until the form is saved - no data is saved with the form as the field is read only. Is it possible that in the fuction that writes the text back to the field, enable the field, write the text then disable it again
This is the code for the field
PHP Code:
var grow = new Ext.form.TextArea({
disabled: true,
autoHeight: false,
allowBlank:false,
width:600, grow:true
});
grow.applyTo('Comments');
Here is the code for the message box
PHP Code:
var btn1 = new Ext.Button('mb2', {text: 'Add your Comments' , handler :
function(e){
Ext.MessageBox.show({
title: 'Comments',
msg: 'Please enter you ideas/ comments',
width:400,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: showResultText1.createDelegate(this), // Set scope or 'this' in function to scope of this function which is Comments
animEl: 'mb2'
})}, scope : grow});
Here is the code for the function that is called
PHP Code:
function showResultText1(btn1, text){
if(btn1=='ok'){
this.setRawValue(this.getRawValue()+"Comments added by "+ authorName+ " on "+ myDate +"\r"+text+"\r"+"\r");
this.autoSize(); // Grow field
}