Basic knowledge †Extended HTML †Alinous-Core extends HTML. Alinous attributes †Alinous attributes are attributes whose name starts with "alns:". Example of Alinous-Core HTML †Following code is the example. <HTML>
<HEAD>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>Input data into database</TITLE>
</HEAD>
<BODY>
<H3>Select DB Form(/select/index.html)</H3><BR>
<TABLE>
<TR>
<TD width="200" bgcolor="#AAAAAA">NAME</TD>
<TD width="200" bgcolor="#AAAAAA">E-MAIL</TD>
<TD width="300" bgcolor="#AAAAAA">COMMENT</TD>
</TR>
<TR alns:iterate="@RECORDS" alns:variable="oneRecord">
<TD width="200" bgcolor="{$BGCOL[$COL % 2]}">{$oneRecord.NAME}</TD>
<TD width="200" bgcolor="{$BGCOL[$COL % 2]}">{$oneRecord.EMAIL}</TD>
<TD width="300" bgcolor="{$BGCOL[$COL++ % 2]}">{$oneRecord.COMMENT}</TD>
</TR>
</TABLE>
<BUTTON alns:back="true">Back</BUTTON>
</BODY>
</HTML>
By watching this example, we can learn following features.
Alinous attributes †Alinous attributes references. alns:back †Automatically generates <FORM> tag with submit button to go back to the last page. <BUTTON alns:back="true">Back</BUTTON> Information.
alns:form †We use this attribute when we show validation failure message with the "alns:msg" attribute. See also alns:msg. Information.
alns:if †If the condition is satisfied, the tag appears. Otherwise, the tag ignored.
<SPAN alns:if="{BOOL($TEST1 != null)}">
If $TEST1 is not null, this message will appear.
</SPAN>
Information.
alns:ignoreblank †If the value of the form input is null, the input will be igonored. <input type="text" name="mail" alns:ignoreBlank="true"> Information.
alns:inner †We specify the default page of the inner container. <TD alns:tagid="contents" alns:inner="default.html" valign="top"> </TD> Information.
alns:iterate †We use this attribute to iterate same pattern for times how many the array's length is. <TR alns:iterate="@RECORDS" alns:variable="oneRecord">
<TD width="200">
{$oneRecord.NAME}
</TD>
<TD width="200">
{$oneRecord.EMAIL}
</TD>
<TD width="300">
{$oneRecord.COMMENT}
</TD>
</TR>
Information.
alns:msg †We use this with the "alns:validate" attribute. <SPAN alns:msg="name" alns:form="searchForm" alns:validate="notNull"> <FONT color="#FF0000">input your NAME</FONT><BR> </SPAN> It is equivalent with following. <SPAN alns:if="{BOOL($ VALIDATE.testForm.testInput.notNull == ture)}">
Error Message
</SPAN>
Information.
alns:regexp †Specifying regular expression to much. Use this attribute with "alns:validate='regex'". Information.
alns:tagid †We can name the <TD> tag with "alns:tagid"; <TD alns:tagid="contents" alns:inner="default.html" valign="top"> Information.
alns:target †The "alns:target" specifies the target part where the reference address of the page specified with the <A> tag.If we want to specify own part, input "this" into this attribute's valus. <A href="/sample/" alns:tagId="targetTdName"> <A href="/sample/" alns:tagId="this"> Information.
alns:validate †We can use validator by using alns:validate attribute. ex. <INPUT type="text" name="name" value="" alns:validate="notNull"> <SPAN alns:msg="name" alns:form="searchForm" alns:validate="notNull"> <FONT color="#FF0000">input your NAME</FONT><BR> </SPAN> By using alns:msg, alns:form and alns:validate attributes with <SPAN> tag, we can show error message. Available value is :-
Information.
custom validator †If you specofied validator name as "custom", the callback function function will be called after posting the form. <input type="text" name="name" value="" alns:validate="custom"> On this case, function validate($formName, $inputName, $value, $IN, $SESSION)
{
if($value == ""){
return "custom";
}
return 0;
}
will be called. If the value is wrong, please return a string value. If the value is correct, return 0.
<input type="radio" name="rtest[]" value="A" alns:validate="custom">A<BR> Then function validateArray($formName, $inputName, @value, $IN, $SESSION)
{
if(Array.size(@value) == 0){
return "custom";
}
return 0;
}
will be called. alns:variable †When we use "alns:iterate", we can specify the name of the temporary variable. <TR alns:iterate="@RECORDS" alns:variable="oneRecord">
<TD width="200">
{$oneRecord.NAME}
</TD>
<TD width="200">
{$oneRecord.EMAIL}
</TD>
<TD width="300">
{$oneRecord.COMMENT}
</TD>
</TR>
Information.
|