We have modified the cell properties window of the table to provide the user with option to select two colors for gradient colors but after the user selects the colors and sets the height for the cell we are not able to set the style attribute of the <td> tag. please help us in this. Please find below the code in the cell properties HTML page. Please guide me on this
//fckeditor\editor\dialog\fck_tablecell.html // Fired when the user press the OK button function Ok() { variable ="FILTER:progid:DXImageTransform.Microsoft.gradient (GradientType=1, startColorstr="+GetE('txtColor1').value+", endColorstr="+GetE('txtColor2').value+"); HEIGHT:"+GetE('txtHeight').value+"px"; //setting the value of style attribute for( i = 0 ; i < aCells.length ; i++ ) { //aCells[i].style = variable ; if ( GetE('txtWidth').value.length > 0 ) aCells[i].width = GetE('txtWidth').value + ( GetE('selWidthType').value == 'percent' ? '%' : '') ; else aCells[i].removeAttribute( 'width', 0 ) ; if ( GetE('selWordWrap').value == 'false' ) SetAttribute( aCells[i], 'noWrap', 'nowrap' ) ; else aCells[i].removeAttribute( 'noWrap' ) ; SetAttribute( aCells[i], 'height' , GetE('txtHeight').value ) ; SetAttribute( aCells[i], 'align' , GetE('selHAlign').value ) ; SetAttribute( aCells[i], 'vAlign' , GetE('selVAlign').value ) ; SetAttribute( aCells[i], 'rowSpan' , GetE('txtRowSpan').value ) ; SetAttribute( aCells[i], 'colSpan' , GetE('txtCollSpan').value ) ; SetAttribute( aCells[i], 'bgColor' , GetE('txtBackColor').value ) ; SetAttribute( aCells[i], 'borderColor' , GetE('txtBorderColor').value ) ; // SetAttribute( aCells[i], 'className' , GetE('cmbFontStyle').value ) ; SetAttribute( aCells[i], 'style' , variable ) ; //not working } return true ; } function SelectBackColor( color ) { if ( color && color.length > 0 ) GetE('txtBackColor').value = color ; } function SelectBorderColor( color ) { if ( color && color.length > 0 ) GetE('txtBorderColor').value = color ; } function SelectColor( wich ) { oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ; } function SelectGradientColor(grad) { oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, grad == 'color1' ? SelectColor1 : SelectColor2,window ) ; } function SelectColor1( color ) { if ( color && color.length > 0 ) GetE('txtColor1').value = color ; } function SelectColor2( color ) { if ( color && color.length > 0 ) GetE('txtColor2').value = color ; } </script> </head> <body scroll="no" style="overflow: hidden"> <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%"> <tr> <td> <table cellspacing="1" cellpadding="1" width="100%" border="0"> <tr> <td> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td nowrap="nowrap"> <span fcklang="DlgCellWidth">Width</span>:</td> <td> <input onkeypress="return IsDigit(event);" id="txtWidth" type="text" maxlength="4" size="3" name="txtWidth" /> <select id="selWidthType" name="selWidthType"> <option fcklang="DlgCellWidthPx" value="pixels" selected="selected">pixels</option> <option fcklang="DlgCellWidthPc" value="percent">percent</option> </select></td> </tr> <tr> <td nowrap="nowrap"> <span fcklang="DlgCellHeight">Height</span>:</td> <td> <input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" /> <span fcklang="DlgCellWidthPx">pixels</span></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td nowrap="nowrap"> <span fcklang="DlgCellWordWrap">Word Wrap</span>:</td> <td> <select id="selWordWrap" name="selAlignment"> <option fcklang="DlgCellWordWrapYes" value="true" selected="selected">Yes</option> <option fcklang="DlgCellWordWrapNo" value="false">No</option> </select></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td nowrap="nowrap"> <span fcklang="DlgCellHorAlign">Horizontal Alignment</span>:</td> <td> <select id="selHAlign" name="selAlignment"> <option fcklang="DlgCellHorAlignNotSet" value="" selected><Not set></option> <option fcklang="DlgCellHorAlignLeft" value="left">Left</option> <option fcklang="DlgCellHorAlignCenter" value="center">Center</option> <option fcklang="DlgCellHorAlignRight" value="right">Right</option> </select></td> </tr> <tr> <td nowrap="nowrap"> <span fcklang="DlgCellVerAlign">Vertical Alignment</span>:</td> <td> <select id="selVAlign" name="selAlignment"> <option fcklang="DlgCellVerAlignNotSet" value="" selected><Not set></option> <option fcklang="DlgCellVerAlignTop" value="top">Top</option> <option fcklang="DlgCellVerAlignMiddle" value="middle">Middle</option> <option fcklang="DlgCellVerAlignBottom" value="bottom">Bottom</option> <option fcklang="DlgCellVerAlignBaseline" value="baseline">Baseline</option> </select></td> </tr> </table> </td> <td> </td> <td align="right"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td nowrap="nowrap"> <span fcklang="DlgCellRowSpan">Rows Span</span>:</td> <td> <input onkeypress="return IsDigit(event);" id="txtRowSpan" type="text" maxlength="3" size="2" name="txtRows"></td> <td> </td> </tr> <tr> <td nowrap="nowrap"> <span fcklang="DlgCellCollSpan">Columns Span</span>:</td> <td> <input onkeypress="return IsDigit(event);" id="txtCollSpan" type="text" maxlength="2" size="2" name="txtColumns"></td> <td></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td nowrap="nowrap"> <span fcklang="DlgCellBackColor">Background Color</span>:</td> <td> <input id="txtBackColor" type="text" size="8" name="txtCellSpacing"></td> <td> <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Back' )"></td> </tr> <tr> <td nowrap="nowrap"> <span fcklang="DlgCellBorderColor">Border Color</span>:</td> <td> <input id="txtBorderColor" type="text" size="8" name="txtCellPadding" /></td> <td> <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Border' )" /></td> </tr> <tr><td nowrap="nowrap"> <span>Gradient Color</span>:</td> <td> <input id="txtBorderColor" type="text" size="8" name="txtColor1" /></td> <td> <input type="button" fcklang="DlgCellBtnSelect" value="Color1" onclick="SelectGradientColor('color1')"></td> <td> <input id="txtBorderColor" type="text" size="8" name="txtColor2" /></td><td> <input type="button" fcklang="DlgCellBtnSelect" value="Color2" onclick="SelectGradientColor('color2')"></td> <td> <input style="display: none;"id="txtBorderColor" type="text" size="8" name="txtColor3" /></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> </html>