Home/Support/Support Forum/RCM4300 and checkbox
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

RCM4300 and checkbox

+1 vote
Hello,

Maybe you could help me.

I would like to use a checkbox under html on my Embedded software.
I've found some help under TCP/IP Volume 2 User’s Manual §5.3.4 but it's not enough for me...

This is my html code I tryed:
<td><INPUT TYPE="hidden" NAME="<?z varname($Enable_SW1) ?>"
VALUE="0">
<INPUT TYPE="checkbox" NAME="<?z varname($Enable_SW1) ?>
VALUE="1"
<?z if ($Enable_SW1 == 1) { ?>
CHECKED
<?z } ?>
</td>

Also in my main file :
protected int Enable_SW1;
#web Enable_SW1;

When I load the page, the checkbox is always false.

If someone could help me, it could be great :)
asked 4 days ago in Rabbit Software by fabrice New to the Community (4 points)

Please log in or register to answer this question.

1 Answer

+1 vote
Instead of manually creating the checkbox, it's probably best to make use of the `field_checkbox` zhtml function.

Put this in your ZHTML file:

<input <?z field_checkbox($Enable_SW1) ?> >

And it should start working. Unfortunately, there aren't any examples to demonstrate that functionality.
answered 4 days ago by TomCollins Veteran of the Digi Community (2,303 points)
Hello,

Your solution is working and more simple.
Also, I foundmy mistake and this code is working :
<INPUT TYPE="hidden" name="Enable_SW1" VALUE="0" >
<INPUT TYPE="checkbox"
<?z if($Enable_SW1==1) { ?>
CHECKED
<?z } ?>
NAME="Enable_SW1" VALUE="1" >

Thanks
...