EasyManua.ls Logo

Carel pCOWeb - Page 72

Carel pCOWeb
90 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
pCOWeb +030220966 – rel. 1.1 – 12.12.2017 72
checkdbsel”: check whether the value of a parameter in a file is “selected”
Returns the “selected” string if the value of the parameter contained in the file indicated by the tag is the same as indicated in the tag itself, otherwise it returns
an empty string.
SYNTAX
<%checkdbsel('Filename', 'ParameterName', 'Value')%>
Used in the construction of drop-down menu with the html “select” command, selects the current value of the parameter.
Example (
Figure G.g
)
With reference to the ‘commcfg’ configuration file already seen for the previous tags; a drop-down menu is created similar to the one used on the configuration
page shown in on page 46, so as to allow the selection between the values 9600, 19200 and 38400; if the parameter in the file is equal to 19200, the menu
will show that value as already being selected.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!--tagparser="/pcotagfilt"-->
<head>
<meta content="text/html; charset=ISO-8859-15" http-equiv="content-type">
<title>pCOWeb Demo Page</title>
</head>
<body bgcolor='#ffffff'>
<h1 style="text-align: center">pCOWeb Demo Page</h1>
<br>
<form method="POST" action="example.html">
<select name="?script:setdb('commcfg','speed')">
<option value="9600" <%checkdbsel('commcfg','speed','9600')%>>9600</option>
<option value="19200" <%checkdbsel('commcfg','speed','19200')%>>19200</option>
<option value="38400" <%checkdbsel('commcfg','speed','38400')%>>38400</option>
</select>
<input type="submit" value="Submit">
</form>
</body>
</html>
Figure G.g - The “checkdbsel” TAG: example
checkdbradio”: check whether the value of a parameter in a file is “checked”
This works in exactly the same way as <%checkdbsel%>, but returns "checked=”checked”" instead of selected and is used for "radio"
buttons, that is, those buttons in which one selection excludes the others.
Example (Figure G.h)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!--tagparser="/pcotagfilt"-->
<head>
<meta content="text/html; charset=ISO-8859-15" http-equiv="content-type">
<title>pCOWeb Demo Page</title>
</head>
<body bgcolor='#ffffff'>
<h1 style="text-align: center">pCOWeb Demo Page</h1>
<br>
<form method="POST" action="example.html">
<input type="radio" name="?script:setdb('clockcfg','clock_sync_enabled')" value="0" id='en_clock_a'
onclick="Check_EnVar('1')" <%checkdbradio('clockcfg','clock_sync_enabled','0')%>>Disabled
<input type="radio" name="?script:setdb('clockcfg','clock_sync_enabled')" value="1" id='en_clock_b'
onclick="Check_EnVar('1')"<%checkdbradio('clockcfg','clock_sync_enabled','1')%>>Enabled
<input type="submit" value="Submit">
</form>
</body>
</html>
Figure G.h
- The “checkdbradio” TAG: example

Related product manuals