Strange formmenu behaviour

The following is my text blaze snippet to do my history section of my notes. For some reason when I click on an item in the selection box / formmenu for the symptoms, associated symptoms, or relevant history the box closes and I need to click on it again before it allows me to add more items. Any idea why it is doing this (only seems to do it these sections)

PS: sorry for the errors, dont have time to edit this right now for posting in the forums

{note: trim=yes; preview=no}
Variables/Lists:
Placeholder complaint / dx: {run: dx= "general"}
Initialize database + selected parts of hx:
{run: db_lists={dbselect: SELECT symptoms, red flags, treatments tried, associated sx, hx components, other hx, symptoms default FROM history WHERE dx / complaint = @dx; space=57Y9Lcf1LFEnYOwzkFVofq; menu=no}
hx_selected= db_lists["hx components"]
symptoms_selected = db_lists["symptoms default"]}
Symptoms: {symptoms_list=db_lists["symptoms"]}
Associated sx: {associated_list=db_lists["associated sx"]}
Other hx: {other_list=db_lists["other hx"]}
Red flags: {red_flags_list=db_lists["red flags"]}
Tx tried: {treatment_list=db_lists["treatments tried"]}
{endnote: trim=yes}
{note: trim=yes}Hx sections: {formmenu: painhx; symptoms; associated sx; other hx; duration; frequency; tx tried; red flags; pmhx; allergies; meds; famhx; pshx; sochx; multiple=yes; name=hx_selected}{endnote}
{if: includes(hx_selected, "painhx")}{import: /template-pain; trim=no}{endif}{if: includes(hx_selected, "symptoms")}
SYMPTOMS: {if: count(symptoms_selected) = 0}none{endif}{note}{formmenu: values={=symptoms_list}; name=symptoms_selected; multiple=yes} {formtext: name=symptoms_add}{button: if symptoms_add = ""
notify("symptoms_add cannot be blank")
return
endif
symptoms_selected = merge(symptoms_selected, [symptoms_add])
symptoms_add = ""
; label=add}{button: symptoms_selected =
; label=unselect all}{button: symptoms_selected = symptoms_list
; label=select all}{endnote}{if: count(symptoms_selected) <> 0}
{repeat: for symptom in symptoms_selected}{=symptom}{formtoggle: default=no} - {formtext}{endformtoggle}{if: location( symptoms_selected, symptom)<count( symptoms_selected)}
{endif}{endrepeat}{endif}{endif}{if: includes(hx_selected, "associated sx")}
ASSOCIATED SYMPTOMS: {if: count(associated_selected) = 0}none{endif}{note}{formmenu: values={=associated_list}; name=associated_selected; multiple=yes} {formtext: name=associated_add}{button: if associated_add = ""
notify("associated_add cannot be blank")
return
endif
associated_selected = merge(associated_selected, [associated_add])
associated_add = ""
; label=add}{button: associated_selected =
; label=unselect all}{button: associated_selected = associated_list
; label=select all}{endnote}{if: count(associated_selected) <> 0}
{repeat: for asx in associated_selected}{=asx}{formtoggle: default=no} - {formtext}{endformtoggle}{if: location( associated_selected, asx)<count( associated_selected)}
{endif}{endrepeat}{endif}{endif}{if: includes(hx_selected, "other hx")}
RELEVANT Hx: {if: count(other_selected) = 0}none{endif}{note}{formmenu: values={=other_list}; name=other_selected; multiple=yes} {formtext: name=other_add}{button: if other_add = ""
notify("other_add cannot be blank")
return
endif
other_selected = merge(other_selected, [other_add])
other_add = ""
; label=add}{button: other_selected =
; label=unselect all}{button: other_selected = other_list
; label=select all}{endnote}{if: count(other_selected) <> 0}
{repeat: for oth in other_selected}{=oth}{formtoggle: default=no} - {formtext}{endformtoggle}{if: location( other_selected, oth)<count( other_selected)}
{endif}{endrepeat}{endif}{endif}{if: includes(hx_selected, "duration")}
DURATION / ONSET: {formtext: name=duration}{endif}{if: includes(hx_selected, "frequency")}
FREQ: {formtext: name=frequency}{endif}{if: includes(hx_selected, "tx tried")}
Tx TRIED: {if: count(treatment_selected) = 0}none{endif}{formmenu: values={=treatment_list}; name=treatment_selected; multiple=yes}{note} {formtext: name=tx_add}{button: if tx_add = ""
notify("tx_add cannot be blank")
return
endif
treatment_selected = merge(treatment_selected, [tx_add])
tx_add = ""
; label=add}{button: treatment_selected =
; label=unselect all}{button: treatment_selected = treatment_list
; label=select all}{endnote}{endif}{if: includes(hx_selected, "red flags")}

RED FLAGS: {if: count(red_flags_selected) = 0}none{endif}{formmenu: values={=red_flags_list}; name=red_flags_selected; multiple=yes}{note} {formtext: name=red_flags_add}{button: if red_flags_add = ""
notify("red_flags_add cannot be blank")
return
endif
red_flags_selected = merge(red_flags_selected, [red_flags_add])
red_flags_add = ""
; label=add}{button: red_flags_selected =
; label=unselect all}{button: red_flags_selected = red_flags_list
; label=select all}{endnote}{endif}{if: includes(hx_selected, "pmhx")}

{import: /chr-pmhx-single}{endif}{if: includes(hx_selected, "allergies")}
{import: /chr-allergies-single}{endif}{if: includes(hx_selected, "meds")}
{import: /chr-meds-single}{endif}{if: includes(hx_selected, "famhx")}
{import: /chr-fhx-single}{endif}{if: includes(hx_selected, "pshx")}
{import: /chr-pshx-single}{endif}{if: includes(hx_selected, "sochx")}
{import: /chr-sochx-single}{endif}

{import: /chr-frx}

Hello @Doc_Krieger,

At least on the version that you shared here, I don't have this issue. I tried copying the snippet and using it but the menu behaves as expected for me.

Could you send me a video via email to obed@blaze.today showing the issue, and perhaps a full working version of your snippet so I can investigate further?

Is the ";" before label there on purpose or would removing it possibly be the solution?

Here is 2 more possible solutions: is the {button:.... }supposed to be in the label box? I see no reference in the form as this text being a field in your returned values. It just kind of floats with no where to go.

We've found the issue causing this bug and we'll be issuing a fix very soon :slight_smile:

1 Like