use javascript on fields to do the extra validation - DataForm.NET Samples

This example shows how to apply Javascript to a field so that you can do something on the field. For instance, validate fields, popup message, etc. In this example, Discount field will validate the input which must be between 0 and 1.

Pick a Theme:

Order IDProduct ID
Unit PriceQuantity
Discount

  Design   Source  
  1. Open DataForm.NET Manager. In DataForm.NET List page, choose Order Details by clicking the link.
  2. In the DataForm.NET Designer on the right hand side, the default tab is DataForm tab.
  3. Click Discount link to bring up a DataForm Field Designer window.
  4. Switch to Script tab. Choose Event, Language and Register Method, then click Build Script link which will generate the script skeleton. Put your code in the function body.
  5. In this example, only numbers between 0 and 1 can be entered into textbox.
  • Click HERE to open up a READ ONLY DataForm.NET Manager.
  • Click HERE to try for yourself.