[Phplib-users] 2 Problems (Reset Button + Template Problem)
Brought to you by:
nhruby,
richardarcher
From: Benjamin H. <ho...@eu...> - 2002-10-09 11:38:08
|
Hi=20 I have two Problems with PHPLIB the first:=20 i have a OOForm with a submit button and a Reset button (to reset = the form) and of course serveral other entry fields ;) My Problem is when i Submit the form and some field was not = validated and i return to the default values with $f->load_defaults(); the Reset button=B4s caption will turn to "" so nothing is written on = it and the size turns to only a few pixel i use this code: if ($SUBMIT) { // Is there data to process? if ($err =3D $f->validate()) { // Is the data valid? //echo $err; // No; Display error $f->load_defaults(); // Load form with submitted data print " there were errors"; }=20 else { /* Process data */ // Data ok; Do something with it } } if i dont use load_defaults everything works fine. my 2. Problem is: isn=B4t it possible to write functions or classfunctions which can = parse Templates ? I have a page with serveral templates on it which will be parsed into = each other. My problem is that i cannot have a function e.g. print_all_news($t) and = gave this funtktion the object of the template which i will use to = append the parsed text of all news to the other content of the page.. If i copy and paste the code (which i want to use for a function) = everything works fine. But if a make a function and include the php or inc where i must use = this function it wont work. But why ??? issn=B4t it possible ??? or am i doing somthing wrong ? Thanks for help=20 Benjamin=20 |