Home | Site map   
  Home Products Downloads Support Contacts
 
 

HowTo: Highlight required form fields

This article will show you how to let your form user know, all at once and before sending the information, about each required field that hasn't been filled in. Each required field will be highlighted in yellow while it is empty.

Steps:

Open PHPRunner project and proceed to Visual Editor tab
In "Edit as" settings check off needed fields as Required Field

For the PHPRunner 5.2/ASPRunnerPro 6.2:

Proceed to the Events tab
Add following code to the JavaScript Onload Event:

var ctrlHorsepower = Runner.getControl(pageid, 'Horsepower');
function func()
{
if (!ctrlHorsepower.getValue())
   ctrlHorsepower.addStyle('background: yellow;');
else
    ctrlHorsepower.addStyle('background: white;');
}
ctrlHorsepower.on('click', func);
ctrlHorsepower.on('keyup', func);

Build your project and view generated files in the browser

The result will be the following:

Applies to:
ASPRunner Pro
PHPRunner

Back to top

 
 

Home | Products | Downloads | Support | Contacts

  ©1999 - 2010 XLineSoft. All rights reserved. All comments send to webmaster@xlinesoft.com