Hello,
I just took notice of the example 3. Variable Access is not working properly. I dont have
any button to press ( method: POST ). So whats up with it?
test.html:
<form action="vars.rvt">
<p>
<input name="title">
<input name="salary">
<input name="boss">
<select name="skills" multiple="multiple">
<option>c</option>
<option>java</option>
<option>Tcl</option>
<option>Perl</option>
</select>
</p>
</form>vars.rvt:
<?
set errlist {}
if { [var exists title] } {
set salary [var get title]
} else {
set errlist "You need to enter a title"
}
if { [var exists salary] } {
set salary [var get salary]
if { ! [string is digit $salary] } {
lappend errlist "Salary must be a number"
}
} else {
lappend errlist "You need to enter a salary"
}
if { [var exists boss] } {
set boss [var get boss]
} else {
set boss "Mr. Burns"
}
if { [var exists skills] } {
set skills [var list skills]
} else {
lappend errlist "You need to enter some skills"
}
if { [llength $errlist] != 0 } {
foreach err $errlist {
puts "<b> $err </b>"
}
} else {
puts "Thanks for the information!"
}
?>
best regards
Patrick N.
|