How to Use Radio button in Joomla frontend componet without using XML form.

1,041 views
Skip to first unread message

Sachin Labade

unread,
Apr 16, 2014, 2:08:49 AM4/16/14
to joomla-de...@googlegroups.com
Hi...
How to use radio button group in frontend form joomla 3.2.3 component without XML form. I want use code in default template. Please let me know how can I write.

--

Thanks And Regards,

 Sachin Labade / PHP Web Developer.
       +91 9552252535 

Hùng Trần

unread,
Apr 16, 2014, 3:10:21 AM4/16/14
to joomla-de...@googlegroups.com
Hi Sachin,

Have you tried to code your radio buttons with HTML only?

Regards,
Hung

TRẦN Duy Hùng


--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

Sachin Labade

unread,
Apr 16, 2014, 3:39:27 AM4/16/14
to joomla-de...@googlegroups.com
Hi Hung ,

Yes . This is my code i have used in default.php file 


<div class="controls">
        <input type="radio" id="radio1" name="jform_gender" value="male">
           <label for="radio1">Male</label>
        <input type="radio" id="radio2" name="jform_gender"value="female">
           <label for="radio2">Female</label>
</div>

But i want to use joomla Radio button groups as boootstrap style. Kindly help me.

Dmitry Rekun

unread,
Apr 16, 2014, 3:57:39 AM4/16/14
to joomla-de...@googlegroups.com
 Have you tried to add BS classes? Like:
class="btn-group btn-group-yesno"

Dmitry

Hùng Trần

unread,
Apr 16, 2014, 3:58:01 AM4/16/14
to joomla-de...@googlegroups.com
Hi Sachin,

I'm not sure I understand what you want correctly. Is this what you want:

<div class="controls">
    <div class="radio btn-group">
        <input type="radio" checked="checked"><label class="btn active btn-danger">Male</label>
        <input type="radio"><label class="btn">Female</label>
    </div>
</div>

Regards,

TRẦN Duy Hùng

Sachin Labade

unread,
Apr 16, 2014, 7:27:14 AM4/16/14
to joomla-de...@googlegroups.com
Thanx for yr reply..

But this is not proper working with my code. I have used ur code as given above.  Give me another solution. 

Hùng Trần

unread,
Apr 16, 2014, 9:04:50 AM4/16/14
to joomla-de...@googlegroups.com
Hi Sachin,

Why it doesn't work for you? You want a different style? If so please attach a sreenshot of what you want. My code is just an suggestion/example, you need to modify it to suit your own code.

TRẦN Duy Hùng

Georgios Papadakis

unread,
Apr 16, 2014, 11:00:30 AM4/16/14
to joomla-de...@googlegroups.com
Hello

1. so you are making a custom component?

2. what exactly is not working ? solution for what ? can you be more specific?


e.g. the saving of the field is not working?

-- if the TASK in your controller that saves the form data is calling Joomla FORM validation
then the field values will be cleared because it does not exist in the XML file (this is for form security)

so add this field must exist in your XML file, even if use custom code that creates it
-- other solution is to backup field value in a variable prior to calling Joomla Form validation and then after validation restore the value


so what exactly is not "working" ?

Regards
Reply all
Reply to author
Forward
0 new messages