22 Feb 03:21
Re: [FormBuilder] Newbie, question about formbuilder
From: Nate Wiger <nwiger <at> gmail.com>
Subject: Re: [FormBuilder] Newbie, question about formbuilder
Newsgroups: gmane.comp.lang.perl.modules.formbuilder
Date: 2007-02-22 02:21:19 GMT
Subject: Re: [FormBuilder] Newbie, question about formbuilder
Newsgroups: gmane.comp.lang.perl.modules.formbuilder
Date: 2007-02-22 02:21:19 GMT
On 2/21/07, Dan Axtell <daniel.axtell <at> snet.net> wrote: > Personally, I think a giant form where you can edit any cell strikes me as a > confusing interface, and problematic as the table gets big. Why not use > Javascript to launch a pop-up form (created by FormBuilder) when you click on > a row, that passes the row values into the form as URL parameters? Sometimes this can be a good interface, if you're working with data that emulates a spreadsheet. I've done this, but to be honest, FormBuilder won't help you here. You'll need to build a standard HTML table (take a look at HTML::QuickTable) and then by far the easiest way I've found is to use jQuery (jquery.com) and the inPlaceEditor plugin here: http://davehauenstein.com/code/?a=inplace If you attach it to each of your rows, and give everything a UNIQUE id that you can parse, you can do a trick like this: id="table_rowid" For example: <td id="cities_100923" class="editable"> ... $('.editable).inPlaceEditor({ url: 'update.pl' }); Then you'll have to write some stub AJAX updating server-side script too. Here's a snip ($sql is an SQL::Abstract object): my($table, $id) = split /[_]+/, $cgi->param('element_id') my($stmt, @bind) = $sql->update($table, {value => $cgi->param('update_value')}, {id => $id}); $dbh->do($stmt, undef, @bind); print $cgi->param('update_value'); -Nate _______________________________________________ FBusers mailing list FBusers <at> formbuilder.org http://www.formbuilder.org/mailman/listinfo/fbusers
RSS Feed