zedlitz Absent Member.
Absent Member.
220 views

TrueFalseRadiobuttons No value selected with own label


Hi All

I found this function for a Boolean TrueFalseRadiobuttons control in
this forum (Thx to Rsynoradzki)

function uncheckRadioBoolean(field) {
var myId = '_'+field.getName();
var myElem = document.getElementsByName(myId);
myElem[0].checked=false;
myElem[1].checked=false;
}

This sets the Boolean TrueFalseRadiobuttons with no selected value, but
the label for the control in the form will be True and False.

Is it possible to add my own label (Yes and No) to the function, if yes
How ????

Thanks in advance


--
zedlitz
------------------------------------------------------------------------
zedlitz's Profile: http://forums.novell.com/member.php?userid=7781
View this thread: http://forums.novell.com/showthread.php?t=452781

Labels (1)
0 Likes
2 Replies
mkreim Absent Member.
Absent Member.

Re: TrueFalseRadiobuttons No value selected with own label

The function below should work for you.

function setLabelRadioBoolean(field, label0, label1) {
var myId = '_'+field.getName();
var myElem = document.getElementsByName(myId);
var parent0 = myElem[0].parentNode;
var text0 = parent0.innerHTML;
parent0.innerHTML = text0.substring(0, text0.indexOf(">") + 1) +
" " + label0;
var parent1 = myElem[1].parentNode;
var text1 = parent1.innerHTML;
parent1.innerHTML = text1.substring(0, text1.indexOf(">") + 1) +
" " + label1;
}


Am 29.02.2012 17:26, schrieb zedlitz:
>
> Hi All
>
> I found this function for a Boolean TrueFalseRadiobuttons control in
> this forum (Thx to Rsynoradzki)
>
> function uncheckRadioBoolean(field) {
> var myId = '_'+field.getName();
> var myElem = document.getElementsByName(myId);
> myElem[0].checked=false;
> myElem[1].checked=false;
> }
>
> This sets the Boolean TrueFalseRadiobuttons with no selected value, but
> the label for the control in the form will be True and False.
>
> Is it possible to add my own label (Yes and No) to the function, if yes
> How ????
>
> Thanks in advance
>
>


0 Likes
zedlitz Absent Member.
Absent Member.

Re: TrueFalseRadiobuttons No value selected with own label


Thx for the reply, I have tested the function and it works great.

I have tested the function on the approval form as well, with minor
changes to the function, but haven´t found a way to change the label and
stille keep the values selected in the request form(Flowdata) in the
approval form, is this possible and how.

THX in Advance


--
zedlitz
------------------------------------------------------------------------
zedlitz's Profile: http://forums.novell.com/member.php?userid=7781
View this thread: http://forums.novell.com/showthread.php?t=452781

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.