Ring Documentation, Release 1.5.3
}
|
textbox([ |
:name |
= |
"Value" |
]) |
|
newline() |
newline() |
|||
divend()
formend()
submit([
:value
=
"Send"
])
Screen Shot:
The Response
Screen Shot:
47.12.
Hash Functions
385
Ring Documentation, Release 1.5.3
47.13 Random Image
#!c:\ring\bin\ring.exe
-cgi
Screen Shot:
47.13.
Random Image
386
Ring Documentation, Release 1.5.3
47.14 HTML Lists
The next example print a list contains numbers from 1 to 10 Then print a list from Ring List. Finally we have a list of buttons and when we press on a button we get a message contains the clicked button number. To start the list we uses the ulstart() function. To end the list we uses the ulend() function. We uses listart() and liend() to determine the list item.
47.14.
HTML Lists
387
Ring Documentation, Release 1.5.3
|
cFuncName |
= "btn"+x+"()" |
||||||
|
button([ |
:onclick |
= |
cFuncName |
, |
:value |
= |
x]) |
script(scriptfuncalert(cFuncName,string(x)))
}
ulend()
next
liend()
Screen Shot:
47.14.
HTML Lists
388
Ring Documentation, Release 1.5.3
47.15 HTML Tables
In this example we will learn how to generate HTML tables using the tablestart(), tableend(), rowstart(), rowend() ,headerstart(), headerend(), cellstart() and cellend() functions.
#!c:\ring\bin\ring.exe
-cgi
Screen Shot:
47.15.
HTML Tables
389
Ring Documentation, Release 1.5.3
47.16 Gradient
In this example we will learn how to use the StyleGradient() function. The function takes the style number as input (range from 1 to 60).
#!c:\ring\bin\ring.exe
-cgi
Screen Shot:
47.16. Gradient
390
Ring Documentation, Release 1.5.3
47.17 Generating Pages using Objects
Instead of using functions/methods to generate HTML pages, we can use an object for each element in the page.
This choice means more beautiful code but slower.
The fastest method is to print HTML code directly, then using functions then using templates then using objects (slower).
47.17.
Generating Pages using Objects
391
Ring Documentation, Release 1.5.3
|
} |
||||||||||
|
Input |
{ |
type |
= |
"submit" |
value = |
"send" |
} |
|||
|
Image |
{ |
src="upload/profile1.jpg" |
alt="profile"} |
|||||||
|
Input |
{ |
type |
= |
"checkbox" value |
= "Old |
Member"} |
text("old |
member") |
||
|
Input |
{ |
type |
= |
"range" |
min=1 max=100} |
|||||
|
Input |
{ |
type |
= |
"number" |
min=1 max=100} |
|||||
|
Input |
{ |
type |
= |
"radio" |
color="black" name="one" |
|||||
|
value |
= |
"one"} |
text("one") |
|||||||
}
}
div
{
color
=
"white"
47.17.
Generating Pages using Objects
392
Ring Documentation, Release 1.5.3
47.17.
Generating Pages using Objects
393
Ring Documentation, Release 1.5.3
47.17.
Generating Pages using Objects
394
Lebih dari sekadar dokumen.
Temukan segala yang ditawarkan Scribd, termasuk buku dan buku audio dari penerbit-penerbit terkemuka.
Batalkan kapan saja.