Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Form builder question

I am building a form using form builder. I need to present users an option to select one image out of ten, I intend to use radio buttons for that. But I cannot see how can I put a thumbnail next to a radio...

What I need is for the form builder to output something like this:
<br /> <input value="4" name="R1" type="radio"><img src="foto/4.jpg"><br /> <input value="5" name="R1" type="radio"><img src="foto/5.jpg"><br /> <input value="6" name="R1" type="radio"><img src="foto/6.jpg"><br />

Is there a FuelCMS way of doing it?

PS I am not quite sure if it is the right place to ask questions, but I see no other fit category...

Comments

  • edited March 31

    Oh, sorry, I do not see how can I delete a comment, so I might as well answer my own question.

    The answer is in reversing the value and key in the $options array:

    <br /> $image_default_options = array('0' => 'Nepasirinkta', '1' => '<img src="foto/1.jpg">', '2' => '<img src="foto/2.jpg">', '3' => '<img src="foto/3.jpg">');<br /> $fields['image_default'] = array('type' => 'enum', 'mode' => 'radios', 'options' => $image_default_options, 'label'=>'Kiti galimi paveikslėliai', 'null' => TRUE);<br />

    I was trying to do it this way at first:
    <br /> '<img src="foto/1.jpg">' => '1'<br />
    And it did not work.

Sign In or Register to comment.