Help! If I press submit, I always get an error. I tried several things for checking the age... but none works! I guess it's again a silly problem. But I can't find it. Help! Thanks. <!--#var standard_html_header--> <h2><!--#var title_or_id--></h2> <p> <form action="Examp2_CheckInput" method="get"> <table> <tr> <td> Name </td> <td> <input name="name:string" type="text"> </td> </tr> <tr> <td> Age </td> <td> <input age="age:int" type="text"> </td> </tr> <tr> <td> Humour </td> <td> <input humour="humour:boolean" type="checkbox"> </td> </tr> </table> <input type="submit" value=" Submit "> </form> </p> <!--#var standard_html_footer--> Examp2_CheckInput ------------------ <!--#var standard_html_header--> <h2><!--#var title_or_id--></h2> <p> <!--Check for age--> <hr> <p> <!--#if "0 <= age <=120"--> Hi <!--#var name-->! <br> you are <!--#var age--> years old <br> <!--#if "humour"--> Great day isn't it? <!--#else--> Did you had a bad day? <!--#/if--> <!--#else--> your age (<!--#var age-->) is ridiculous, it should be between 0 and 120!<hr> <a href="Examp2_form" Please fill in the form correctly> <!--#/if--> </p> <hr> <p> </p> <!--#var standard_html_footer--> Tom.
Tom Deprez wrote: If you view the source of the page with the error, you will see something like name error: age This means that there is no variable being passed to the CheckInput page called age. In the input page, there is a simple HTML error that can be fixed. <input age="age:int" type="text"> should be <input name="age:int" type="text"> The same problem exists with the input for humor. With these fixes, it works like a charm. -- Jim Washington
Help!
If I press submit, I always get an error. I tried several things for checking the age... but none works! I guess it's again a silly problem. But I can't find it. Help! Thanks.
<!--#var standard_html_header--> <h2><!--#var title_or_id--></h2> <p>
<form action="Examp2_CheckInput" method="get">
<table> <tr> <td> Name </td> <td> <input name="name:string" type="text"> </td> </tr>
<tr> <td> Age </td> <td> <input age="age:int" type="text"> </td> </tr>
<tr> <td> Humour </td> <td> <input humour="humour:boolean" type="checkbox"> </td> </tr> </table>
<input type="submit" value=" Submit ">
</form>
</p> <!--#var standard_html_footer-->
Examp2_CheckInput ------------------
<!--#var standard_html_header--> <h2><!--#var title_or_id--></h2> <p>
<!--Check for age--> <hr> <p> <!--#if "0 <= age <=120"--> Hi <!--#var name-->! <br> you are <!--#var age--> years old <br> <!--#if "humour"--> Great day isn't it? <!--#else--> Did you had a bad day? <!--#/if--> <!--#else--> your age (<!--#var age-->) is ridiculous, it should be between 0 and 120!<hr> <a href="Examp2_form" Please fill in the form correctly> <!--#/if--> </p> <hr> <p>
</p> <!--#var standard_html_footer-->
Tom.
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
If you view the source of the page with the error, you will see something like
name error: age
This means that there is no variable being passed to the CheckInput page called age.
The strange thing is that I didn't received such an error... only, this website has some problems...
In the input page, there is a simple HTML error that can be fixed.
<input age="age:int" type="text">
should be <input name="age:int" type="text">
blush, blush....
With these fixes, it works like a charm.
Okidoki, After chaging some thingies Renamed names to input... because 'name' is used by Zope. Put #if expr ="" (used expr, because without it I got errors) Still I've three problems : 1. This part is the one : when checkbox 'inputhumour' is checked everything works fine. If it isn't---> error (the site is currently experiencing ..... ) <!--#if expr="inputhumour"--> Great day isn't it? <!--#else--> Did you had a bad day? <!--#/if--> inputhumour==true or inputhumour=1 gives also problems... 2. If the age is wrong (<0 or >120) I let the user go back to the form. Problem: the values are gone. How can I let the user go back so that his/her entered values are still there? 3. If the user has entered text in the form, I get a form explaining that it has to be an integer. Can I intercept this and show my own page (other language, more info,...) Pfew,... I'm almost there..... Is there somebody still willing to help this dumb person? Thanks.
If I press submit, I always get an error. I tried several things for checking the age... but none works! I guess it's again a silly problem. But I can't find it. Help! Thanks.
<!--#var standard_html_header--> <h2><!--#var title_or_id--></h2> <p>
<form action="Examp2_CheckInput" method="get">
<table> <tr> <td> Name </td> <td> <input name="name:string" type="text"> </td> </tr>
<tr> <td> Age </td> <td> <input age="age:int" type="text"> </td> </tr>
<tr> <td> Humour </td> <td> <input humour="humour:boolean" type="checkbox"> </td> </tr> </table>
<input type="submit" value=" Submit ">
</form>
</p> <!--#var standard_html_footer-->
Examp2_CheckInput ------------------
<!--#var standard_html_header--> <h2><!--#var title_or_id--></h2> <p>
<!--Check for age--> <hr> <p> <!--#if "0 <= age <=120"--> Hi <!--#var name-->! <br> you are <!--#var age--> years old <br> <!--#if "humour"--> Great day isn't it? <!--#else--> Did you had a bad day? <!--#/if--> <!--#else--> your age (<!--#var age-->) is ridiculous, it should be between 0 and
120!<hr>
<a href="Examp2_form" Please fill in the form correctly> <!--#/if--> </p> <hr> <p>
</p> <!--#var standard_html_footer-->
Tom.
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Tom Deprez wrote:
Still I've three problems :
1. This part is the one :
when checkbox 'inputhumour' is checked everything works fine. If it isn't---> error (the site is currently experiencing ..... )
<!--#if expr="inputhumour"--> Great day isn't it? <!--#else--> Did you had a bad day? <!--#/if-->
inputhumour==true or inputhumour=1 gives also problems...
got that prev msg. You are welcome.
2. If the age is wrong (<0 or >120) I let the user go back to the form. Problem: the values are gone. How can I let the user go back so that his/her entered values are still there?
Assuming you are going back to the same form, it can be constructed with something like: <input name="age" type="text" <!--#if age--> value="<!--#var age-->" <!--#/if-->
3. If the user has entered text in the form, I get a form explaining that it has to be an integer. Can I intercept this and show my own page (other language, more info,...)
Here's a hint: <!--#if "age[0] in _.string.digits"--> <!--#if "0 <= _.string.atoi(age) <=120"--> -- Jim Washington
Tom Deprez wrote: And one more. In Examp2_CheckInput, remove the quotes around humour in <!--#if "humour"-->. humour apparently is not sent if it is not checked, and the page will fail if humour is unchecked. <!--#if humour--> will work, since this is a check for existence, not value. --Jim Washington
Help!
If I press submit, I always get an error. I tried several things for checking the age... but none works! I guess it's again a silly problem. But I can't find it. Help! Thanks.
<!--#var standard_html_header--> <h2><!--#var title_or_id--></h2> <p>
<form action="Examp2_CheckInput" method="get">
<table> <tr> <td> Name </td> <td> <input name="name:string" type="text"> </td> </tr>
<tr> <td> Age </td> <td> <input age="age:int" type="text"> </td> </tr>
<tr> <td> Humour </td> <td> <input humour="humour:boolean" type="checkbox"> </td> </tr> </table>
<input type="submit" value=" Submit ">
</form>
</p> <!--#var standard_html_footer-->
Examp2_CheckInput ------------------
<!--#var standard_html_header--> <h2><!--#var title_or_id--></h2> <p>
<!--Check for age--> <hr> <p> <!--#if "0 <= age <=120"--> Hi <!--#var name-->! <br> you are <!--#var age--> years old <br> <!--#if "humour"--> Great day isn't it? <!--#else--> Did you had a bad day? <!--#/if--> <!--#else--> your age (<!--#var age-->) is ridiculous, it should be between 0 and 120!<hr> <a href="Examp2_form" Please fill in the form correctly> <!--#/if--> </p> <hr> <p>
</p> <!--#var standard_html_footer-->
Tom.
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
At 13:32 29.04.99 +0200, Tom Deprez wrote:
Help!
If I press submit, I always get an error. I tried several things for checking the age... but none works! I guess it's again a silly problem. But I can't find it. Help! Thanks.
[snip]
<td> <input name="name:string" type="text"> </td>
Lucky one -- see below :-) [snip]
<td> <input age="age:int" type="text">
Should be <input name="age:int" type="text"> ^^^^ [snip]
<td> <input humour="humour:boolean" type="checkbox">
Again: <input name="humour:int" type="text"> Hope this helps! .co. ---------------------------------------------- daisy bytes! --------- Carsten Oberscheid co@daisybytes.su.uunet.de digital document processing http://www.peb.de/daisybytes.su electronic publishing
participants (3)
-
Carsten Oberscheid -
Jim Washington -
Tom Deprez