You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by SmAsH <pa...@freenet.de> on 2003/07/04 21:45:56 UTC
example doesnt work
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.
Re: example doesnt work
Posted by "David N. Welton" <da...@dedasys.com>.
"SmAsH" <pa...@freenet.de> writes:
> Err sorry, messed the numbers up =) Example 4. File Upload is not
> working I onyl have the 'Search' button but I cant submit anything
> for uploading.
Hrm. I attempted to keep those examples really simple, in order to
concentrate on the important elements, but maybe I made them too
simple. Of course you need to add a submit button - which I have done
in CVS:
<form action="foo.rvt" enctype="multipart/form-data" method="post">
<input type="file" name="MyUpload"></input>
<input type="submit" value="Send File"></input>
</form>
Ciao,
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: example doesnt work
Posted by SmAsH <pa...@freenet.de>.
Err sorry, messed the numbers up =) Example 4. File Upload is not working I
onyl have the 'Search' button but I cant submit anything for uploading.
best regards
Patrick N.
----- Original Message -----
From: "David N. Welton" <da...@dedasys.com>
To: <ri...@tcl.apache.org>
Sent: Saturday, July 05, 2003 4:32 PM
Subject: Re: example doesnt work
> "SmAsH" <pa...@freenet.de> writes:
>
> > Yep the other example you've given me works fine now, but the
> > example1 of the rivet-page wont work either so could you give me
> > also a working one concerning the example1?
>
> Mmm, which one do you mean, exactly?
>
>
> --
> David N. Welton
> Consulting: http://www.dedasys.com/
> Personal: http://www.dedasys.com/davidw/
> Free Software: http://www.dedasys.com/freesoftware/
> Apache Tcl: http://tcl.apache.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: example doesnt work
Posted by "David N. Welton" <da...@dedasys.com>.
"SmAsH" <pa...@freenet.de> writes:
> Yep the other example you've given me works fine now, but the
> example1 of the rivet-page wont work either so could you give me
> also a working one concerning the example1?
Mmm, which one do you mean, exactly?
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: example doesnt work
Posted by SmAsH <pa...@freenet.de>.
Yep the other example you've given me works fine now, but the example1 of
the rivet-page wont work either so could you give me also a working one
concerning the example1?
best regards
Patrick N.
----- Original Message -----
From: "David N. Welton" <da...@dedasys.com>
To: <ri...@tcl.apache.org>
Cc: <pa...@freenet.de>
Sent: Saturday, July 05, 2003 3:47 PM
Subject: Re: example doesnt work
>
> [ Reposting - I seem to have some mail troubles. ]
>
> "SmAsH" <pa...@freenet.de> writes:
>
> > 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?
>
> It works ok for me, but I went ahead and spruced up the HTML some,
> so it looks a little nicer, and to show some results.
>
> <form action="ex2.rvt" method="POST">
> <table>
> <tbody>
> <tr>
> <td><b>Title:</b></td>
> <td><input name="title"></td>
> </tr>
> <tr>
> <td><b>Salary:</b></td>
> <td><input name="salary"></td>
> </tr>
> <tr>
> <td><b>Boss:</b></td>
> <td><input name="boss"></td></tr>
> <tr>
> <td><b>Skills:</b></td>
> <td>
> <select name="skills" multiple="multiple">
> <option>c</option>
> <option>java</option>
> <option>Tcl</option>
> <option>Perl</option>
> </select>
> </td>
> </tr>
> <tr>
> <td><input type="submit"></td>
> </tr>
> </tbody>
> </table>
> </form>
>
> -----
>
> <?
> set errlist {}
> if { [var exists title] } {
> set title [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!"
> ?>
> <table>
> <tbody>
> <tr>
> <td><b>Title:</b></td>
> <td><? puts $title ?></td>
> </tr>
> <tr>
> <td><b>Boss:</b></td>
> <td><? puts $boss ?></td>
> </tr>
> <tr>
> <td><b>Salary:</b></td>
> <td><? puts $salary ?></td>
> </tr>
> <tr>
> <td><b>Skills:</b></td>
> <td><? puts $skills ?></td>
> </tr>
> </tbody>
> </table>
> <?
> }
> ?>
>
> I will commit that later - does it work for you?
>
> --
> David N. Welton
> Consulting: http://www.dedasys.com/
> Personal: http://www.dedasys.com/davidw/
> Free Software: http://www.dedasys.com/freesoftware/
> Apache Tcl: http://tcl.apache.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: example doesnt work
Posted by "David N. Welton" <da...@dedasys.com>.
[ Reposting - I seem to have some mail troubles. ]
"SmAsH" <pa...@freenet.de> writes:
> 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?
It works ok for me, but I went ahead and spruced up the HTML some,
so it looks a little nicer, and to show some results.
<form action="ex2.rvt" method="POST">
<table>
<tbody>
<tr>
<td><b>Title:</b></td>
<td><input name="title"></td>
</tr>
<tr>
<td><b>Salary:</b></td>
<td><input name="salary"></td>
</tr>
<tr>
<td><b>Boss:</b></td>
<td><input name="boss"></td></tr>
<tr>
<td><b>Skills:</b></td>
<td>
<select name="skills" multiple="multiple">
<option>c</option>
<option>java</option>
<option>Tcl</option>
<option>Perl</option>
</select>
</td>
</tr>
<tr>
<td><input type="submit"></td>
</tr>
</tbody>
</table>
</form>
-----
<?
set errlist {}
if { [var exists title] } {
set title [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!"
?>
<table>
<tbody>
<tr>
<td><b>Title:</b></td>
<td><? puts $title ?></td>
</tr>
<tr>
<td><b>Boss:</b></td>
<td><? puts $boss ?></td>
</tr>
<tr>
<td><b>Salary:</b></td>
<td><? puts $salary ?></td>
</tr>
<tr>
<td><b>Skills:</b></td>
<td><? puts $skills ?></td>
</tr>
</tbody>
</table>
<?
}
?>
I will commit that later - does it work for you?
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org