Picon

[FormBuilder] file/directory chooser for the server side?

Hello,

I use Formbuilder to create usermin modules for my company. 
Now I need a file/directory chooser but for the remote files. 

With "$form->field(name => 'inputFile', label => 'Input file', type => file);"
I get as expected only a local file chooser. 

In the user-/webmin framework I could use "&file_chooser_button" which gives 
me a file/directory chooser on the the server side. 
Is it possible to use "&file_chooser_button" inside formbuilder or is there an 
other way to get an file/directory chooser dialog for the server side inside 
formbuilder?

regards,
Sascha
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

Kevin Jordan | 6 Mar 19:08
Picon

[FormBuilder] How to validate input not in list?

I need to be able to validate that the information the user puts in a field on my form is NOT in a long list that I have in a file.
The reason behind this being I never want the same value used twice.  For example, once a username is used, I don't want to allow someone to request it again.
 
What is the best way to do this?
 
 
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
Ryan Tate | 4 Mar 02:21

[FormBuilder] requiring any of several fields

As far as I can tell, there is no way to require that any one of
several fields be present.

I have an app where I need either field1 or field2 filled out. Neither
on its own is required, and a validate method attached to either field
would not detect when both are empty because it would never get
called!

The workaround for me is to inspect the form after it is submitted,
andmake sure one of the fields is set. If not, I mark one field as
invalid and set its message to something useful, then send the form
back to the user.

What would be more useful would be a formwide_validate callback that
checks the whole form, as opposed to a particular field like normal
validate. This would be the logical place to do what I'm trying to
accomplish.

$form->formwide_validate(sub{
  my $form = shift;
  ($form->field('foo') || $form->field('bar')) or return;
  return 1;
});
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

Troy Davis | 2 Mar 17:08

[FormBuilder] ETA on new release with mem leak fix and regex validation with commas?

Is there an ETA on a new release that incorporates the memory leak and regex fixes?


http://www.formbuilder.org/pipermail/fbusers/2007-February/000140.html

I tried to build from the svn trunk, but I can't figure out how. Never seen Makefile.PL in a subdirectory before, I keep getting:

Could not open 'lib/CGI/FormBuilder/Util.pm': No such file or directory

What is the recommended method for building from svn?

I also navigated to the readme in the repository and tried the svn://... URL, I get connection refused. 

http://www.formbuilder.org/repos/formbuilder/README

Thank You,
Troy

_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
Daniel Vela | 21 Feb 22:43
Picon

[FormBuilder] Newbie, question about formbuilder

I am new to formbuilder but what I have used I have found very usefull, thanks.  Now here is my problem, a have a table with data:

table1
==========================
=column 1  |  column2 |  column3 =
==========================
= row1       |  data1      | data12     =
= row2       |  data2      | data22     =
= row3       |  data3      | data32     =
= row4       |  data4      | data42     =
==========================

I want my form to go thru all the rows in table 1 and populate the forms like below on one screen:

                  _____
Field Name  | row1|
                  ______
Option         | data1|
                  _______
Fields         | data12|

                  _____
Field Name  | row2|
                  ______
Option         | data2|
                  _______
Fields         | data22|

                  _____
Field Name  | row3|
                  ______
Option         | data3|
                  _______
Fields         | data32|

Then I want to be able to modify any of the form boxes and be able to submit it.  Is this possible?  Is there an example I can study?

Thanks

Daniel Vela

_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
Mordion Gall | 12 Feb 22:58
Picon
Favicon

[FormBuilder] how to attach formbuilder?

Hi, can someone tell me how to attach the form made by Formbuilder to the website I'm making?

Never Miss an Email
Stay connected with Yahoo! Mail on your mobile. Get started!
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
José Parrella | 10 Feb 23:53
Picon

[FormBuilder] CGI::FB and XHTML 1.1

I've been validating some of my applications using CGI::FB with the W3C
validator, and it seems that the 'name' and 'charset' attributes are not
allowed inside the <form> tag. However, setting a 'name' for the form is
essential in order to get special stylesheeting over elements with id's
like FormName_Field_Element. Also, setting 'charset' is useful for
internal uses. Not dumping name= and charset= in the <form> tag would be
nice, since it would still allow internal methods to access those
options while being XHTML 1.1 compliant.

I've been browsing the code but I can't point where the actual <form>
tag is built. In Template/Builtin.pm, however, I assume it's comming
from $form->text. I tried, unsuccesfully, to track $form down the parent
methods.

Maybe a 'compat' option in the new() method could prove useful (instead
of just changing this things to make CGI::FB compliant). Another change
that is needed is the removal of the <noscript> part in the JS output.

This could be accomplished avoiding "push @html, $form->noscript if
$js;" in Builtin.pm

Jose

--

-- 
José M. Parrella -> Debian Sid, k2.6.18
Escuela de Ingenieria Electrica
Universidad Central de Venezuela -> ucvlug.info
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
José Parrella | 10 Feb 23:28
Picon

[FormBuilder] Using UTF-8 templates in CGI::FB

Greetings,

I've been developing a UTF-8 based Web application in spanish (es_ES)
with CGI::FormBuilder, which already provides templates for this
language. However, I get weird characters in all JS messages, as well as
errors from the W3C Validator. Please note that I'm not an expert in
this topic, but I think I've narrowed the problem to:

a) The es_ES.pm messages file is encoded in ISO-8859-1 (I opened it with
a UTF-8 aware text editor and rewrote it, then checked it with `file
es_ES.pm` which says that now it is a UTF-8 file)

b) The functions in FormBuilder.pm that write the actual JavaScript code
are using "return <string>", and this last step is not UTF-8 aware (I
don't know why, though). If I add "use Encode;" and then return
encode_utf8(<string>); I get the proper code in the HTML output.

Also, most scripts I checked in were not using "use utf8;". I don't know
if this is mandatory of if it actually helps with something, but just in
case. Can somebody explain to me a proper way to do UTF-8 based forms
with sane characters in the JS alerts and so on?

Jose

--

-- 
José M. Parrella -> Debian Sid, k2.6.18
Escuela de Ingenieria Electrica
Universidad Central de Venezuela -> ucvlug.info
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
kevin montuori | 9 Feb 23:56
Picon

[FormBuilder] validate + commas in FB source files


hi all -- first off, CGI::FB is a great module.  it's saved me
countless hours of tedious mind-numbing typing.  thanks a lot to
nate and anyone else responsible.

i have a question about using CGI::FormBuilder::Source::File with
regexps in the validate field: one of the things i really want to do
is make sure the length of the input is between a min and max value:

  validate: /^\w{3,32}$/

and it seems like this sort of thing would be not atypical.
unfortunately, the regex is split into two values when there's a comma
in the regex (via $source->write_module()):

  'validate' => [
                  '/^\\w{3',
                  '32}$/'

so : is there a canonical way of checking for min/max length that i'm
not aware of?  

would there be any interest in changing File.pm (~ line 155) from:

   # split commas
   @val = split /\s*,\s*/, $line;

to something like:

   # split commas
   my $split_regex = lc $term eq 'validate'
     ? qr/\s*(?<!\\),\s*/ : qr/\s*,\s*/;
   @val = split $split_regex, $line;

which would allow this statement in the source file:

   validate: /^\w{3\,32}$/

to produce the more useful:

  'validate' => '/^\\w{3\\,32}$/'

it's easy enough to maintain my own source adapter that had this
particular tweak (and having that hook is damn good thinking) but i
thought maybe this would be more broadly useful.

thanks for your time.

cheers.
k.

--

-- 
kevin montuori
montuori <at> gmail.com
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

Hornet | 5 Feb 23:43
Picon

[FormBuilder] Default Values.

Hello All,

Just want to start out by saying, this is a really great API and easy
to use. Which must be my problem. Below is the code I'm working with.
The problem I'm having is that I can't get the radio button or
checkbox to be either on or off. The $notact with either be 1 or 0,
yet nothing is checked. I thought I was doing what the documentation
was telling me. Can anyone see what I'm doing wrong?

sub edituser {
	&noauth if !&admin;
	&phead;
	my $stmt="select Users.Username, Users.Password, Users.BmsCustId,
Users.Email, Users.FullName, Users.NotActive, Groups.Group as fGroup
		from Users
	        left join Groups on Groups.pkey = Users.Group
		where Users.pkey=$input{edituser}";

	my $h=$dbh->selectrow_hashref($stmt);
	print dumper_html($h);
	my $notact=$h->{NotActive};
	delete $h->{NotActive};
	
	my $group=$dbh->selectall_arrayref("select Groups.Group from Groups");

	$form = CGI::FormBuilder->new(
			fields =>$h,
			smartness => 2,
	);
	$form->field(name=>'NotActive', value=> $notact, options=>"Deactivate
account");
#	print $q->checkbox(-name=>'NotActive', -checked=>$notact,
-label=>'Deactivate acccount'),
	print $form->render;
	
	&leave;
}

--

-- 

-Erik-
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

Dan Axtell | 4 Feb 21:33
Favicon

[FormBuilder] Dynamic fields and templates

Hi,

I'm tying to build a form where most of the fields are standard fields, laid 
out via a template, but with a section where some fields may or may not be 
added dynamically, depending on the record type I'm editing.

The idea was that at run time I'd do something like:

my $tmpl = HTML::Template->new( ...)
$tmpl->param('form-start'  => "<tmpl_var form-start>"); 
$tmpl->param('form-submit' => "<tmpl_var form-submit>");
# all standard field template tags get replaced by themselves
# for FormBuilder to expand ...

$tmpl->param('dynamic-controls' => \@list_of_extra_fields);

# Now create the form object
my $form->CGI::FormBuilder->new( 
  fields =>\@list_of_all_fields,
  template => $tmpl,
   ....
);

This fails because $tmpl is an HTML::Template object and doesn't have a 
render() method.

Is subclassing CGI::FormBuilder::Template::HTML the only way to get something 
like this to work?   It seems odd that the template attribute can be an 
object reference but NOT an HTML::Template reference.
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers


Gmane