Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > JavaScript API > Examples

How to change font in "edit" controls

Scroll Prev Next More

 

You can change the font in the "edit" controls in the following ways:

 

1. Change the font in one "edit" control

Use the following code in the JavaScript OnLoad event:

 

var ctrl = Runner.getControl(pageid, 'Make');
ctrl.addStyle('font-size: 12px; color: red;');

 

To get more information about using JavaScript API, see JavaScript API.

2. Change the font for all "edit" controls on one page

Proceed to the Editor screen, open the page you need to modify, click on the Custom CSS button and add the following code there:

 

input,textarea {
color:#003333;
font-family:Verdana,Arial,SunSans-Regular,Sans-Serif;
font-size:12pt;
}

 

Note: You can also add this code on the Page Designer screen. Click the Custom CSS button to do so.

 

or use the following code in the JavaScript OnLoad event:

 

$("input, textarea").css( {fontSize: '120%', color: 'red'} );

3. Change the font for all "edit" controls in the project

Change the description of the control style (INPUT, TEXTAREA) in the styles\default.css file in the folder of the generated project:

change_edit_controls_1

 

Alternatively, you can change the description of the control style directly in the ASPRunner.NET install folder - the \ASPRunner.NET10.91\styles\default.css:

change_edit_controls_2

See also:

JavaScript API: Control object > getControl()

JavaScript API: Control object > add CSS Class

Customizing CSS examples

Conditional formatting

JavaScript API: Control object

JavaScript API