susom / redcap-em-shazam

Shazam External Module
MIT License
18 stars 11 forks source link

How does dropdown integration work? #47

Closed palacity closed 1 year ago

palacity commented 2 years ago

Hi,

wanted to add a dropdown menu to a table basically just like this:

<tr>
    <th><select>
        <option>one</option>
        <option>two</option>
    </select></th>
</tr>

<

When I did, the code snippet starting with "select" was shown as plain text instead of working as a dropdown menu. What could cause this issue? Standard text input fields are working fine.

Thanks!

123andy commented 2 years ago

You need to provide more detail - I can't tell if that code is what you entered into the Shazam HTML pane or into the REDCap field label or what.

Ideally, can you show a public survey with the code and a copy of what your shazam JS and HTML panes look like.

palacity commented 2 years ago

Thanks for the quick reply.

Link: https://redcap-cert.uk-erlangen.de/surveys/?s=N3C777RLX9TPAAWD

Full HTML: `

<tr>
    <td><input type="text"></td>
    <td><input type="text"></td>
    <td><input type="text"></td>
    <td><input type="text"></td>

<td>
   <select>        
        <option value="opt1">Opt1</option>
        <option value="opt2">Opt2</option>
        <option value="opt3">Opt3</option>
   </select>
</td>     

</tr>

Monday Tuesday Wednesday Thursday Friday
`

JS: none

123andy commented 1 year ago

Hi @palacity - Shazam wasn't intended for you to write your own inputs -- it was intended to pipe REDCap field_names into locations. So, if you have an input you want to place in that table, then create it as a REDCap question and include it in the piped html. I feel like I'm missing something there...