Friday, August 12, 2011

Jomsocial checkbox, radio buttons tooltip & validation bugs & solution

Have Joomla site?
Installed Jomsocial Component?
Created checkboxes or radio buttons using custom fields?
Suffering from checkboxes & radio buttions tooptip & Validatation of these fields wokring after submitting form(basically functionality should be to have alertbx with error message like other inputs). Then you must read this post & follow all the steps.

These are the Jomsocial bugs. You can find these bugs in latest verison(2.2.4) also don't know why these guys haven't sorted out yet. We were suffering from this problem for 2Lush cru site. We told client its Jomsocial bug but as usual, he was not ready to accept & told to do whatever to solve these issues. I know, this issue was in PMS from last 1-2 months no one was able to solve it.

If you want to sort out these bugs the you need to hack the jomsocial files cause you can't override these files which you need modified. Dont worry it won't affect your jomsocial at all.

To remove empty tooltips from check box fields.
go to file components/com_community/libraries/fields/checkbox.php
line no. 36
$cclass = ($field->required == 1) ? ' required validate-custom-checkbox' : '';
line no. 60
Change only class name
$html .= 'input type="checkbox" name="field' . $field->id . '[]" value="' .
$option . '"' . $selected . ' class="checkbox '.$class.'" style="margin: 0 5px
5px 0;" />';
change to
$html .= 'input type="checkbox" name="field' . $field->id . '[]" value="' .
$option . '"' . $selected . ' class="checkbox '.$cclass.'" style="margin: 0 5px
5px 0;" />';

Validation of checkbox
line no. 44
$class = !empty( $field->tips ) ? 'jomTips tipRight' : '';
change to
$class .= !empty( $field->tips ) ? ' jomTips tipRight' : '';
public_html/components/com_community/libraries/fields/radio.php

Same for radio button validation
go to the file components/com_community/libraries/fields/radio.php
Just update file as above.

5 comments:

  1. You are one good web developer. Thanks for these information on web development. It would be great to learn from you.

    ReplyDelete
  2. Hello,
    I am using joomsocial2.2.4 with joomla1.7 & I am facing problem to add event. It shows blank page. But it is working fine in joomla1.5.x. Please advise.

    Yogendra Gautam
    yogendrag@smartdatainc.net

    ReplyDelete
  3. Thank you for sharing this post about the best techniques for Joomla Development, This is very useful for Joomla Development and Joomla Development Company. Thanks again :) Joomla Development

    ReplyDelete
  4. Thank you soo much! this gave me an idea!! Problem Solved!

    ReplyDelete