This topic is locked

Is there a way to add attributes to specific fields?

4/14/2009 7:20:04 AM
PHPRunner General questions
E
erc author

Title says it all.
I'm using the evaluation version right now to see if it'll meet my needs. Is there any way to add a class or style attribute (or other attributes) to a specific field?

J
Jane 4/14/2009
E
erc author 4/14/2009

I'm using this on an Add Record page, so I've tried adding the following code:

global $record;

$record["MailingAddress1_style"]='style="width:100%"';


in both the Add page: Before process and Add page: Before display events. Neither seems to have affected the final output HTML at all.
Any suggestions?

J
Jane 4/14/2009

Hi,
this code works in the List page: After record processedevent only.

To change style for each field on the add/edit pages edit HTML code on theVisual Editortab.

E
erc author 4/14/2009

Is that possible? Since the visual editor shows what I assume are smarty tags in place of the HTML for the fields, I don't understand how you can assign a class to a particular field.

Sergey Kornilov admin 4/14/2009

You can proceed to Visual Editor, make field selected and switch to HTML mode.
In HTML mode you can wrap field value into a SPAN assigning a proper style.
Example:

<span class="classname">{$FieldName_value}</span>