-
AuthorPosts
-
conforturis Friend
conforturis
- Join date:
- April 2010
- Posts:
- 256
- Downloads:
- 0
- Uploads:
- 58
- Thanks:
- 59
- Thanked:
- 7 times in 1 posts
May 15, 2014 at 4:29 pm #197817Hi
I want to create some read-only field with just a link of some documentation for users can read before fill others fields below.
Please see exempleHow can I do this?
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
May 16, 2014 at 4:07 am #535383In your case, you need to create new form field type SEPERATOR for Job form with settings as in attached image below. (Please execute rebuilding database step to get the field dipslayed on form.)
And edit code in the file “components/com_jajobboard/asset/rendfield.php” to get it done. Find code snippet (on the top of the file):
[PHP]function rendfieldlabel($field) {
return (isset($field->label_ml) && !empty($field->label_ml)) ? $field->label_ml : $field->label;
}[/PHP]And replace it with:
[PHP]function rendfieldlabel($field) {
$r = (isset($field->label_ml) && !empty($field->label_ml)) ? $field->label_ml : $field->label;if($field->field_type == ‘SEPERATOR’) {
if(!empty($field->field_init)) {
$r = sprintf(‘<a href=”%s” title=”%s” target=”_blank”>%s</a>’, $field->field_init, addslashes($r), $r);
}
}
return $r;
}[/PHP]Once done, you should get the field as follows:
-
conforturis Friend
conforturis
- Join date:
- April 2010
- Posts:
- 256
- Downloads:
- 0
- Uploads:
- 58
- Thanks:
- 59
- Thanked:
- 7 times in 1 posts
May 16, 2014 at 2:58 pm #535441Is there a way to apply css code in that particular field?
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
May 19, 2014 at 2:21 am #535601In the “form field customization” form, you can see the field named “Class name” where you can define extra css class for that field, and you can add custom css code for this class to style for that field then.
Please have a look at our documentation here to learn more how to customize form field.
conforturis Friendconforturis
- Join date:
- April 2010
- Posts:
- 256
- Downloads:
- 0
- Uploads:
- 58
- Thanks:
- 59
- Thanked:
- 7 times in 1 posts
May 19, 2014 at 2:54 pm #535716We fill this field with class name some classe name of my template and nothing happens.
And why this class field only accepts ten characters?
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
May 20, 2014 at 3:02 am #535789<blockquote>We fill this field with class name some classe name of my template and nothing happens.</blockquote>
To solve this issue, please follow steps below:– Open the file
components/com_jajobboard/views/jajobs/tmpl/jaform.php-Find the code snippet below:
[PHP]<tr class=”sectiontableheader”>
<td colspan=”2″>
<?php echo rendfieldlabel($field);?>
</td>
</tr>[/PHP]– And replace it with:
[PHP]<tr class=”sectiontableheader <?php echo @$field->field_class; ?>”>
<td colspan=”2″>
<?php echo rendfieldlabel($field);?>
</td>
</tr>[/PHP]– Do the same steps for the file:
components/com_jajobboard/views/jajobs/tmpl/japremiumform.php<blockquote>And why this class field only accepts ten characters?</blockquote>
To sort this out, steps below should help:– Open the file: administrator/components/com_jajobboard/views/jamanagefields/tmpl/form.php
– Find the code line:
[PHP]<input class=”inputbox” type=”text” name=”field_class” size=”60″ maxlength=”10″ value=”<?php echo $this->item->field_class; ?>” />[/PHP]
– And replace it with:
[PHP]<input class=”inputbox” type=”text” name=”field_class” size=”60″ value=”<?php echo $this->item->field_class; ?>” />[/PHP]1 user says Thank You to Thanh Nguyen Viet for this useful post
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)This topic contains 6 replies, has 2 voices, and was last updated by Thanh Nguyen Viet 10 years, 6 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum