# Double calls to setter function when using checkbox in AWS

**URL:** <https://forums.digi.com/t/double-calls-to-setter-function-when-using-checkbox-in-aws/5891>\
**Category:** NET+OS\
**Created:** [September 25, 2009, 3:29pm UTC](https://forums.digi.com/t/double-calls-to-setter-function-when-using-checkbox-in-aws/5891 "2009-09-25T15:29:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![d\_s\_spence](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@d\_s\_spence](https://forums.digi.com/u/d_s_spence)\
**Post date:** [September 25, 2009, 3:29pm UTC](https://forums.digi.com/t/double-calls-to-setter-function-when-using-checkbox-in-aws/5891/1 "2009-09-25T15:29:35Z")

</div>

Hi,

I am using NET+OS 7.4 on a ConnectCore 9P 9215. The target device is built around the NS9215 module.

I am adding a web interface to the control application that will allow field testing of the device.

I am using checkboxes for the digital outputs. They are working, but the setter function is being called twice for each checkbox that is checked.

Here is what I have in the html:

Digital outputs:

Each setter function (setDigitalOutput1(), setDigitalOutput2(), setDigitalOutput3()) is called first with a value of false, then each setter is called again for the checkboxes that are ticked, with a value of true.

Am I doing something wrong?

I should be able to filter this in my application, but I’d rather not have to. 🙂

---

<div class="post-metadata">

**Author:** ![sparkys\_dad](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@sparkys\_dad](https://forums.digi.com/u/sparkys_dad)\
**Post date:** [September 25, 2009, 5:26pm UTC](https://forums.digi.com/t/double-calls-to-setter-function-when-using-checkbox-in-aws/5891/2 "2009-09-25T17:26:17Z")

</div>

Hello

```
I am curious why you are using the value for the RpSetType and RpGetType attributes of complex instead of function. I believe complex is generally used with repeat groups and (I believe) generates different c code (through the PBuilder utility) then does function. Try changing complex to function and let the forum know if the problem is addressed.

```

---

<div class="post-metadata">

**Author:** ![d\_s\_spence](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@d\_s\_spence](https://forums.digi.com/u/d_s_spence)\
**Post date:** [September 25, 2009, 6:40pm UTC](https://forums.digi.com/t/double-calls-to-setter-function-when-using-checkbox-in-aws/5891/3 "2009-09-25T18:40:15Z")

</div>

Thank you for your response.

I was using type complex instead of function because I initially copied the checkbox code from network\_config.htm in the web/html directory. Thank you for pointing that out to me, because type function is simpler.

Changing to type function does not change the behaviour, but I have found the following text in the AWS documentation:

“Because HTML forms submit only the check box items that are checked on a form, the RomPager engine turns off all check boxes on a form at the beginning of form processing. As the form is processed, the checked individual check box items are set to on.”

So I am dealing with it by storing the values in static variables in the \_v.c file and committing the values to the hardware in the digitalIOSubmit() function.
