New form not saving data

aperezcrespo wrote on Friday, June 13, 2008:

Hi
  I just made a new form using the formtool.pl.  I moved it to the forms directory, registered, installed and enabled it.  It shows up just nicely.  But when I click on submit none of the selected checkboxes get updated in MySQL.
The other portions are updated id,date,pid,user,group,authorized and activity just fine.

What log files can I start looking at?

Thanks
Alfonso

markleeds wrote on Friday, June 13, 2008:

oh boy, I think your right that there’s a bug.  I set up the example form you provided and it records checks from the second set but not the first.  I thought I had everything working.  I’ll take a close look, probably a problem in save.php.

aperezcrespo wrote on Friday, June 13, 2008:

sorry I didnt mention that I had done a CVS update and updated with MYSQL 2.8.4 and thats when it broke.  Prior to this I had forms that did work.

Thanks
Alfonso

aperezcrespo wrote on Tuesday, June 17, 2008:

Hi Mark
I looked in save.php in one of my forms and I saw $nev, I thought it should have been $neg. So I changed it to $neg, but that did not work.

So I took a look at formtool.pl and found on line 202
  $pos = ‘’;
  $nev = ‘’;

So I changed it to
  $pos = ‘’;
  $neg = ‘’;

I created a new form and it worked.

A word of warning though, dont take my word on this double check it very carefully.

Thanks
Alfonso

markleeds wrote on Tuesday, June 17, 2008:

Alfonso,

That’s probably it.  Thanks for working on it and finding the bug.  If PHP has a strict mode that requires variables to be declared, I should probably be using it.  That’s a typical bug for me, a dumb spelling mistake.

Mark

markleeds wrote on Tuesday, June 17, 2008:

oh, if you make a change to formscript.pl and run it again on the same template file without changing your fields at all, you can copy over the newly generated form and use it in place of the previously generated form.  You don’t have to throw away the broken form, just regenerate it (as long as fields not changed).

aperezcrespo wrote on Tuesday, June 17, 2008:

Good point on re-gen and its logical.

I ran into this because I have a client that wants his forms to be real pretty.  To emulate my clients environments I keep a windows PC to work from.

Could you recommend a HTML/PHP WYSIWYG app for modifing the form files?  It has to be something really geared to my level (two neurons above brain-dead).  I’ve been using Notepad++ and Coffee Free HTML.  But the Coffee doesnt show the text from the xl() functions.

Thanks
Alfonso

markleeds wrote on Tuesday, June 17, 2008:

I don’t know what I would use to modify forms to make them look pretty.  I have never been good at making web pages look nice.

Regarding the xl() function issue, look at the formscript.pl documentation, which you can see just by running the script by itself without a template file name.  There is a command line option for creating a form without the xl() functions.

aperezcrespo wrote on Wednesday, June 18, 2008:

Yeah, guess we’re both in the same boat on that.  I don’t want to strip out the xl() function just in case the form is generic enough to upload into the contrib directory.

Thanks