pre-checked checkboxes

112 views
Skip to first unread message

SK

unread,
Aug 20, 2012, 11:18:25 AM8/20/12
to heo-i...@googlegroups.com
I have encountered an issue in a VGR iForm where a checkbox initialized to a checked state and unchecked by a user returns to the checked state after the form is redisplayed.  How do I keep the current state of the field when the VGR script has encountered an error and the form is redisplayed to the user?

Russ Garlow

unread,
Aug 20, 2012, 1:02:21 PM8/20/12
to
On your VGR error Checking, do you have it set to:
EDIT, EXIT,THIS
??

or do you have it set to restart?

SK

unread,
Aug 21, 2012, 8:07:39 AM8/21/12
to heo-i...@googlegroups.com
EDIT,IF,,error_flag,NE,,THEN
EDIT,EXIT,THIS

 

Scott Morris FMC

unread,
Aug 21, 2012, 8:38:25 AM8/21/12
to heo-i...@googlegroups.com
Ok, question #2: In the HTML for this particular checkbox, does it have the word "checked" or is it only being initialized as pre-checked by your VGR?  If it is in your HTML, try taking it out and test.

Example:
<input type="checkbox" value="true" checked name="chk" id="chk" />

SK

unread,
Aug 23, 2012, 3:37:19 PM8/23/12
to heo-i...@googlegroups.com
<INPUT type="checkbox"  id="chk_cardiac" name="chk_cardiac" value="checked" checked>
 
The box needs to be checked when the form displays. The user has the option to uncheck it when the field does not apply to the patient. If I remove the "checked" option how do I have the box initially appear as checked?    

Scott Morris FMC

unread,
Aug 23, 2012, 3:58:29 PM8/23/12
to heo-i...@googlegroups.com
Change your html to be:

<INPUT type="checkbox"  id="chk_cardiac" name="chk_cardiac" value="checked">

Then in your VGR, initialize the variable to be

INIT,SET,CHECKBOX,chk_cardiac,to,"checked"

I'm guessing that it's currently initialized as:
INIT,SET,CHECKBOX,chk_cardiac,to,

SK

unread,
Aug 24, 2012, 11:52:19 AM8/24/12
to heo-i...@googlegroups.com
I followed your suggestion and the issue has been resolved.  Thanks very much for the assistance.

Scott Morris FMC

unread,
Aug 24, 2012, 12:55:03 PM8/24/12
to heo-i...@googlegroups.com
Glad to help!  I've marked the last response (the one with the code) as the "official" answer for future reference.

Schanta Ball

unread,
Jun 7, 2013, 10:01:12 AM6/7/13
to heo-i...@googlegroups.com
I have an unchecked checkbox, that's loading in HEO as checked. Has anyone seen that error?

html
<td width="2%"><input name="type_and_crossmatch_CB" type="checkbox" value="true"/></td>
<td width="48%"> Type and crossmatch 2 units packed red blood cells</td>

Russ Garlow

unread,
Jun 7, 2013, 10:07:24 AM6/7/13
to heo-i...@googlegroups.com
can you post your VGR init for that checkbox?
Reply all
Reply to author
Forward
0 new messages