fck textfield












var oEditor = window.parent.InnerDialogLoaded() ;

// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;

var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;

window.onload = function()
{
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;

if ( oActiveEl && oActiveEl.tagName == 'INPUT' && ( oActiveEl.type == 'text' || oActiveEl.type == 'password' ) )
{
GetE('txtName').value = oActiveEl.name ;
GetE('txtValue').value = oActiveEl.value ;
GetE('txtSize').value = GetAttribute( oActiveEl, 'size' ) ;
GetE('txtMax').value = GetAttribute( oActiveEl, 'maxLength' ) ;
GetE('txtType').value = oActiveEl.type ;

GetE('txtType').disabled = true ;
}
else
oActiveEl = null ;

window.parent.SetOkButton( true ) ;
window.parent.SetAutoSize( true ) ;
}

function Ok()
{
if ( isNaN( GetE('txtMax').value ) || GetE('txtMax').value < 0 )
{
alert( "Maximum characters must be a positive number." ) ;
GetE('txtMax').focus() ;
return false ;
}
else if( isNaN( GetE('txtSize').value ) || GetE('txtSize').value < 0 )
{
alert( "Width must be a positive number." ) ;
GetE('txtSize').focus() ;
return false ;
}

if ( !oActiveEl )
{
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
oActiveEl.type = GetE('txtType').value ;
oEditor.FCKUndo.SaveUndoStep() ;
oActiveEl = oEditor.FCK.InsertElement( oActiveEl ) ;
}

oActiveEl.name = GetE('txtName').value ;
SetAttribute( oActiveEl, 'value' , GetE('txtValue').value ) ;
SetAttribute( oActiveEl, 'size' , GetE('txtSize').value ) ;
SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ;

return true ;
}










Name





Value





Character Width





Maximum Characters





Type

Text
Password



 











Wyszukiwarka

Podobne podstrony:
fck textfield
textfieldsframe
textfile
textfile
textfieldsframe
fck anchor
textfile
textfile
fck paste
textfile
textfile
textfile
textfile
TextFileFilter
textfile

więcej podobnych podstron