We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31381
    • 31 Posts
    Hi,

    I try to use Jot as a kind of contact board.
    So people should enter their name, e-mail and a short text and they have to choose between two options.

    My problem is: how to manage, that people can for example tip a radio button on Jot an the comments.html gives out what was ticked.

    Here is what I was trying so far:

    I found this:
    http://www.partout.info/gaestebuch_modx.html
    That’s an introduction for an guestbook (it’s German).

    There I’ve cut the select-list out and left only two options to choose (radio buttons would be much better - but I haven’t any clou how to get them with Jot).

    I but a new custom field called "ort" - and put it into the snippet-call.

    I put something like this in the form:
    looks like this
    <label for="ort[+jot.id+]">Ort:</label>
    <select tabindex="[+jot.seed:math=`?+3`+]" name="ort" id="ort[+jot.id+]" size="2">
    <option value="1">one or</option>
    <option value="2">another</option>
    </select>


    With the plan to let PHx find out wheather "ort" ist "1" or "2" and put out text.

    Later I changed it to:
    <label for="ort[+jot.id+]">Ort:</label>
    <select tabindex="[+jot.seed:math=`?+3`+]" name="ort" id="ort[+jot.id+]" size="2">
    <option value="[+form.field.custom.vote:esc+]">one or</option>
    <option value="[+form.field.custom.vote:esc+]">another</option>
    </select>


    and hoped, that
    [+comment.custom.ort+]
    bring out "one or" or "another"

    but - neight the one nor the other version mad anything good.

    What do you think - is my problem that Jot can’t do radiobuttons or something - do I have to less clou about Jot oder about forms?

    Would be glad about advices - can’t image, that modx can’t do that - cause modx can everything (so far...).


      • 31381
      • 31 Posts
      Found the solution in the German forum:

      http://www.modxcms.de/forum/comments.php?DiscussionID=324&page=1#Comment_19405

      Have to write it like:
      value="[+form.field.custom.anything+]valueitshouldhave"
        • 31381
        • 31 Posts
        Hi,

        new problem:

        I would like to valdidate the radiobuttons. People should have to tick one of them (without have one checked in the beginning).

        Tried it that way:
        [[Jot? &customfields=`ort,name,email` &validate=`name:name missing,ort:ort missing,content:content missing`]]

        -> name and content are validated like they should - but "ort", the radiobuttons, aren’t.
        Do I have to give it a special validate rule?!


          • 15155
          • 11 Posts
          Would you be so kind as to show me how to add a dropdown list <select> element to a jot form?