Difference between revisions of "Using an HTML Tag to Create Action Events"

From SmartWiki
Jump to: navigation, search
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
You can use a combination of the HTML Tag on any input field and a browser script to create '''action''' events. For an input field, you can use HTML event functions such as '''onchange''', '''onblur''', '''onfocus''', etc. to trigger actions in which you can define in a browser script [[Custom Fields|custom field]].
+
{{JavaScript Syntax}}
 +
You can use a combination of the HTML Tag on any input field and a browser script to create '''action''' events. For an input field, you can use HTML event functions such as '''onchange''', '''onblur''', '''onfocus''', etc. to trigger actions which you can define in a browser script [[Custom Fields|custom field]].
  
 
For example, in an input [[Custom Fields|custom field]] we put an '''onchange''' event in the '''HTML Tag''' box:
 
For example, in an input [[Custom Fields|custom field]] we put an '''onchange''' event in the '''HTML Tag''' box:
  
 
[[Image:Poa.png]]
 
[[Image:Poa.png]]
+
 
 
Then in the browser script we can define the '''JavaScript''' function:
 
Then in the browser script we can define the '''JavaScript''' function:
  
Line 11: Line 12:
 
They can reference other fields that appear on the same form page, but they will have to know the field '''name/id''' (not the [[Custom Fields|custom field]] name) in order to get it to work.
 
They can reference other fields that appear on the same form page, but they will have to know the field '''name/id''' (not the [[Custom Fields|custom field]] name) in order to get it to work.
  
[[Category: JavaScript Examples]]
+
See also [[Using a Check Box to run a JavaScript]]
 +
 
 +
[[Category:JavaScript]][[Category:Custom Fields]]

Latest revision as of 16:26, 10 September 2018

This feature uses JavaScript syntax
Text code javascript.gif

You can use a combination of the HTML Tag on any input field and a browser script to create action events. For an input field, you can use HTML event functions such as onchange, onblur, onfocus, etc. to trigger actions which you can define in a browser script custom field.

For example, in an input custom field we put an onchange event in the HTML Tag box:

Poa.png

Then in the browser script we can define the JavaScript function:

Poa1.png

They can reference other fields that appear on the same form page, but they will have to know the field name/id (not the custom field name) in order to get it to work.

See also Using a Check Box to run a JavaScript