NTGrE
asked on
2 functions compination...
Hello.....
I m tying to compine 2 functions....
1st)
function checkForm(theBtn, checkElem){
var elem = theBtn.form.elements;
for(var i=0;i<elem.length;i++){
if(checkElem[elem[i].class Name]){
elem[i].disabled=(elem[i]. className! =theBtn.va lue);
}
}
}
a pair of radio buttons...
<input name="sel_shpm" type="radio" value="pre" checked="checked" onclick="checkForm(this,{p re:1,'new' :1})" />
<input name="sel_shpm" type="radio" value="new" onclick="checkForm(this,{p re:1,'new' :1})" />
and the textarea..
<textarea id="new_shpm_pol" name="new_shpm_pol" cols="60" rows="10" disabled="disabled" class="new">
With this function i enable/disable the textarea
Now i want to add one more function to my radio buttons..
function setTextareaToTinyMCE(sEdit orID) {
var oEditor = document.getElementById(sE ditorID);
if(oEditor && !bTextareaWasTinyfied) {
tinyMCE.execCommand('mceAd dControl', true, sEditorID);
bTextareaWasTinyfied = true;
}
return;
}
function unsetTextareaToTinyMCE(sEd itorID) {
var oEditor = document.getElementById(sE ditorID);
if(oEditor && bTextareaWasTinyfied) {
tinyMCE.execCommand('mceRe moveContro l', true, sEditorID);
bTextareaWasTinyfied = false;
}
return;
}
onClick="unsetTextareaToTi nyMCE('new _shpm_pol' );"
to the first radio button and
onClick="setTextareaToTiny MCE('new_s hpm_pol'); "
to the second radio button.
How can i do this???
I m tying to compine 2 functions....
1st)
function checkForm(theBtn, checkElem){
var elem = theBtn.form.elements;
for(var i=0;i<elem.length;i++){
if(checkElem[elem[i].class
elem[i].disabled=(elem[i].
}
}
}
a pair of radio buttons...
<input name="sel_shpm" type="radio" value="pre" checked="checked" onclick="checkForm(this,{p
<input name="sel_shpm" type="radio" value="new" onclick="checkForm(this,{p
and the textarea..
<textarea id="new_shpm_pol" name="new_shpm_pol" cols="60" rows="10" disabled="disabled" class="new">
With this function i enable/disable the textarea
Now i want to add one more function to my radio buttons..
function setTextareaToTinyMCE(sEdit
var oEditor = document.getElementById(sE
if(oEditor && !bTextareaWasTinyfied) {
tinyMCE.execCommand('mceAd
bTextareaWasTinyfied = true;
}
return;
}
function unsetTextareaToTinyMCE(sEd
var oEditor = document.getElementById(sE
if(oEditor && bTextareaWasTinyfied) {
tinyMCE.execCommand('mceRe
bTextareaWasTinyfied = false;
}
return;
}
onClick="unsetTextareaToTi
to the first radio button and
onClick="setTextareaToTiny
to the second radio button.
How can i do this???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
:))