I'm looking for a way to put images into my umbraco form which the user can click (a happy and sad face). they are to be used as radiobuttons, but I have no clue on how to start doing this. I 'have trouble finding documentations or threads that answer my problem.
I recently did this exact same thing on the Healthy Young Minds site with restricted timescales.
Effectively created a proxy so the smiley faces are plain HTML items (li's) and when clicked use client-side JavaScript to select the relevant form radio button (notated by a [data-target] attribute) and submit the (hidden) form; and handle the response.
The first part is working.
I use a modal that shows the smileys faces, and I'm able to fill the umbraco form based on what smiley is clicked. I was wondering how you posted the form. The form doesn't have an Id like the radiobuttons for example.
I tried giving the form an id by getting the form out of the div it is nested in with ` document.getElementById("contourform432a28f341884231b1acdefd863ebc85").firstChild.id = "postForm";
But this doesn't seem to work as it messes up my html.
var parentDiv = document.getElementById("contour_form_432a28f341884231b1acdefd863ebc85");
var list = parentDiv.childNodes;
list[1].id = "actualForm";
document.getElementById("actualForm").submit();
Umbraco forms: use images as radiobuttons.
Hi,
I'm looking for a way to put images into my umbraco form which the user can click (a happy and sad face). they are to be used as radiobuttons, but I have no clue on how to start doing this. I 'have trouble finding documentations or threads that answer my problem.
Can someone help?
Thanks in advance,
I recently did this exact same thing on the Healthy Young Minds site with restricted timescales.
Effectively created a proxy so the smiley faces are plain HTML items (li's) and when clicked use client-side JavaScript to select the relevant form radio button (notated by a [data-target] attribute) and submit the (hidden) form; and handle the response.
Hey Christopher,
The first part is working. I use a modal that shows the smileys faces, and I'm able to fill the umbraco form based on what smiley is clicked. I was wondering how you posted the form. The form doesn't have an Id like the radiobuttons for example. I tried giving the form an id by getting the form out of the div it is nested in with ` document.getElementById("contourform432a28f341884231b1acdefd863ebc85").firstChild.id = "postForm";
But this doesn't seem to work as it messes up my html.
This worked:
Thanks!
I'll do just that! It's a bit inconvenient as it would be alot easier to just use a basic umbraco form, but the client wants what the client wants.
is working on a reply...