Easily create forms with no HTML or PHP knowledge. Questions can be made compulsory and are checked before the form is submitted. Forms can be previewed. (You can create multiple forms)
Hey! I'm having a small problem with a custom question that defaults to the users age. I'm having problems validating the input when the form is submitted.
For my custom question I have this code (this part works):
I want the user to be able to change the age I default the question to. I also want to make sure that input is a valid number so I wrote a few lines to do that.
In the "Before Submit" area I have this: (my custom question has an id of 15)
PHP Code:
$q[15] = (int)$q[15]; //make sure we only have a number
if($q[15] < 18) $q[15] = 18;
if($q[15] > 120) $q[15] = 120;
Here is where the problem comes in! When the forum is submitted or previewed the text in the age field shows up but my "Before Submit" code does not take effect. So if I were to type "cool" in the age field it shows "cool" in the preview instead of showing 18 as I would expect (type casting 'cool' to an int should return zero, zero is less than 18 so it should be set to 18).
Any help would be great! I'm sure it's just something little I am missing. I know what I am doing may seem a little silly out of context but I want it to work this way.
Im posting this with the disclaimer of many others. I have tried searching this thread but its huge and I've had no luck at the moment so my apology if its been answered.
If it helps any I've Installed* Rated 5 Stars and Nominated as its well deserved for all 3 in my opinion. I can do anything with this.
My problem is this. In the vb form options you can set it for the button to show up in your navbar which I have done. I use a custom template so what I need to do is assign the button a defined height and width along with a class for it to blend nicely with my layout. I have looked in the header and other locations that I can think of looking for anyway to add my desired values but I never see any reference of the button along side the other navbar buttons. Where do I need to be to achieve this?
My sincere thanks
Atm, you have to edit a plugin.
But in v3.7 (available very soon) you can just customise the template form_navbar
Hey! I'm having a small problem with a custom question that defaults to the users age. I'm having problems validating the input when the form is submitted.
For my custom question I have this code (this part works):
I want the user to be able to change the age I default the question to. I also want to make sure that input is a valid number so I wrote a few lines to do that.
In the "Before Submit" area I have this: (my custom question has an id of 15)
PHP Code:
$q[15] = (int)$q[15]; //make sure we only have a number if($q[15] < 18) $q[15] = 18; if($q[15] > 120) $q[15] = 120;
Here is where the problem comes in! When the forum is submitted or previewed the text in the age field shows up but my "Before Submit" code does not take effect. So if I were to type "cool" in the age field it shows "cool" in the preview instead of showing 18 as I would expect (type casting 'cool' to an int should return zero, zero is less than 18 so it should be set to 18).
Any help would be great! I'm sure it's just something little I am missing. I know what I am doing may seem a little silly out of context but I want it to work this way.
In Before Submit plugin remove any comments or use instead:
PHP Code:
/* start comment here
end comment */
eg.
PHP Code:
$q[15] = (int)$q[15]; /*make sure we only have a number*/ if($q[15] < 18) $q[15] = 18; if($q[15] > 120) $q[15] = 120;
Just noticed there's an update for this mod...v3.7beta. Are there any release notes as to what this update includes? Also, are there any upgrade instructions?
Just noticed there's an update for this mod...v3.7beta. Are there any release notes as to what this update includes? Also, are there any upgrade instructions?
Thanks, bananalive...for another great mod!
Version history contains latest additions:
Quote:
v3.7
- Added template hook for form hidden fields
- Added compulsory question * as phrase
- Form Results Table and Form Results Poll moved to templates
- Form Navbar link moved to tempalte
- JavaScript sort results table
- added permissions for Usergroups to view form results (those who can edit forms can also view form results)
Installation Instructions:
Import product file in admincp
upload easyforms.js and easyforms.css to clientscript/
This is displayed on the forms..."Please Note: Questions proceeded by an asterisk (*) are compulsory." Actually, the asterik (*) does not proceed the question, but appears after the question. Also...anyway to change this and make the asterisk (*) red in color?
Updated to 3.7 beta and upload the js files. To sort column, just click on the column header name and an arrow down will appear next to the header name.
This is not too obvious to people since it's hard to tell you can sort. Maybe we can add a filter section on top to display only the columns we want in case we have 20+ columns?