Welcome, Guest

Function script set a checkbox unchecked
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Function script set a checkbox unchecked

Function script set a checkbox unchecked 2 years, 2 months ago #10358

Here's a little trick to make an unchecked checkbox with a button for example:

Function:

function mf_setUnchecked(name, value, checked)
{
    if (arguments.length<3) checked = false;
    for (var i = 0; i < ff_elements.length; i++)
        if (ff_elements[i][2]==name) {
            var e = ff_getElementByIndex(i);
            if (e.value == value) {
                e.checked = checked;
                break;
            } // if
        } // if
} // mf_setUnchecked

Custom code for the button:

function ff_MyButton_action(element, action)
{
    switch (action) {
        case 'click':

mf_setUnchecked('name','value');

            break;
        default:;
    } // switch
} // ff_MyButton_action


it also works with the radio button.
  • izikit
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Karma: 0
  • Page:
  • 1
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.29 seconds

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany