News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Custom Form Mod

Started by live627, July 09, 2008, 10:24:44 PM

Previous topic - Next topic

Garou

That  would be nested  or multi-teared selection boxes and no its not possible at this time, I also don't think it can be possible with the current way the mod is structured. The HTML code involved is "option groups" and there isn't really a decent way to create them with a program such as this. Its much better suited to a stand alone form.

As far as where this mod posts, it will never be able to do anything but a forum post with this mod.

deciph3red

#761
Thanks for the quick reply!

I still love it.

ɔɔɔɔɔɔuɥoɾ

I requested a mod recently, this seems similar to what I requested, just asking to be sure

http://www.simplemachines.org/community/index.php?topic=336535.0

Does this mod do that?


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

rgecy

Didn't know if this had been requested yet or not, but thought it would be a great addition to the mod.

We need a description field for the field names so it would give the user a little more information on what to enter.  Here is an example of what I did using html.  It can be done this way, but would be much simpler if it was incorporated into the mod.

Thanks again!

Robert

Garou

johncccccc, This is more like what you are looking for. http://www.tinyportal.net/index.php/topic,9419.0.html I use to use it before I found the custom form mod. Its not really a mod but more of a hack that you have to install manually, and really requires either Tiny Portal or you can probably make it work using some other portal software. Alternatively if you don't want to use portal software you can make it work using the custom action mod, http://custom.simplemachines.org/mods/index.php?mod=331.

With the form mod the user fills out a regular form and then it put those answers in a forum post based on the format you set up. I think the form mod is a better option especially once we get a few more features added to it, like being able to use the new topic button to open a form. (Yes I'm working on this folks I just want to get rid of some or preferably all of the existing bugs first.) Then again I am biased as I now work on the mod but I did make the switch before I started working on it.  ;D

rgecy, You don't really need to add another field for this to work just use some basic HTML in your "Text " field.

For instance
This is the question to be answered. <br /> <i>This is how your answer should be formatted.</i>

It will display in the form as...
QuoteThis is the question to be answered.
This is how your answer should be formatted.     [       ]

You can also use the "Info box" to add additional instructions, line breaks, horizontal rules, or even advertisements between questions.

Being able to use these two existing features makes the mod extremely flexible for just this type of situation as well as many others. Its much better the bloating the mod with extra unnecessary code that wouldn't be useful to everyone.

ɔɔɔɔɔɔuɥoɾ

hmmm, So with the custom form mod, when someone starts a topic, the post can be pre filled with some information, thus making all topics 1st posts uniform (if the user uses them) for example, if I wanted to have a aboard where everything is listed, I could set up that board with the custom form fill to
1.
2.
3.
and so forth

Saving the user time having to do that.
or is the hack/manual install for that?


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Garou

Not exactly, right now Custom Form Mod does not start when some one clicks new topic but that feature is planned for the future. For now you have to tell your users to go to the form and you can use the board settings to set the board as read only or reply only so they can not post to the board with out using a form.

Second it doesn't pre-fill a post (that is the other option I pointed you to) it actually creates a post based on the answers a user gives when they fill out a form.

You create a form where you set up fields like name, age, op_system, etc. When you set up those fields you also set up the questions to be answered.

What is your name?                           [     ]
How old are you in years?                  [     ]
What operating system do you use?   [     ]

Then you set up the format that you want the answers to be posted into.

Hi, my name is {name}.
I am {age} years old.
My computer runs on on {op_system}.

Then when your user fills out the form and answers with ...
What is your name?                           [Garou]
How old are you in years?                  [38]
What operating system do you use?   [Linux]

A post is created that says...
Hi, my name is Garou.
I am 38 years old.
My computer runs on on Linux.

A new topic is created in a board of your choosing, using that format, every time a user fills out the form.

Does that make more sense to you?

ɔɔɔɔɔɔuɥoɾ

Yea, that makes more sense, I pretty much assumed that but wanted to get a clearer answer.

I'm curious to know, how much different is your mod and my idea code wise, would it be a lot of work to make it standard on the default form on a chosen board?


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

rgecy

Garou,

Like I said in my post, I know it can be done with HTML, thats how I did it.  I just think it would be a nice addition to the mod.  There are a lot of users who don't know how to format html.

Just a thought.

RGecy

Garou

johncccccc, if you are just wanting the pre-formatted text in the post with out the user filling out a form you should use the custom prefills hack I mentioned earlier. That's an entirely different concept and wouldn't be possible with this mod.

Of you are looking to redirect the user to a custom form rather then creating a new topic,  FragaCampos made this suggestion http://www.simplemachines.org/community/index.php?topic=248871.msg2241024#msg2241024. That will do the trick but I plan to add something better to the mod in the future.

rgecy, for those that don't know HTML there are several examples in this thread of how to do that type of thing and they can always ask here. As for adding the field to the mod I just don't really see it as something that's necessary when it can be done quite simply by adding the little bit of HTML that isn't much different from BBC in the "Text" field.

More importantly there are many features on the very long "to do list" that actually add to the functionality and usability of the mod rather then just redoing something that can already be done in a slightly different way. Seriously it isn't that hard to add a <br /> to the existing field.

ɔɔɔɔɔɔuɥoɾ

OK then, got it, just wanted to know that. :)


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

rgecy

Garou,

I certainly understand!  :D  I agree, they can find the info here if needed. 

I truly appreciate the work on this mod.  Thanks again!

RGecy

Sramota

Since I can't search for it...

Anyone noticed you can't enter a "0" as an answer when it's set to integer..?

Garou

Actually you can not enter just a "0" in a text or float box either. Its a common problem using just about any type of form software  because "0" is considered the same as null or empty in most programing languages.

In the case of this mod "0" will leave the field blank when it posts to the forum, as if the user hasn't filled anything in at all. Its even worse the field is required as the mod specifically rejects "0" as an answer when required mainly for the fact that again "0" is considered the same as empty.

There might be some sort of string replace function that could be added which means using a regular expression and I'm terrible when it comes to those.  :-[ Ill have to try some things out to see if I can get it to work and make sure that it doesn't replace empty fields with "0".

Sramota

textbox works for me.. :S

tonnybarros

Hello, I use this MOD and I think very good, but every message that the members not to send the messages that appear in the member profile that appears in messages.
pesquisar

http://tectonny.com

Garou

Sramota, You are correct text boxes are working with "0". Originally I didn't test it I just went looking on the internet for answers and found several instances of where "0" doesn't work with input boxes and made the assumption that it applied to this mod.

After testing I found that the problem is caused by this code in the CustomForm.php

case 'int':
$value = isset($_REQUEST[$field['title']]) ? intval($_REQUEST[$field['title']]) : '';
// If value is empty then set it to the default.
if(($value == '')
&& !$required)
$value = $default;
// Restrict the length of value if necessary.
if(($size != ''))
$value = substr($value, 0, $size);
break;
case 'float':
$value = isset($_REQUEST[$field['title']]) ? floatval($_REQUEST[$field['title']]) : '';
// If value is empty then set it to the default.
if(($value == '')
&& !$required)
$value = $default;
// Restrict the length of the float value if necessary.
if(($size != ''))
$value = rtrim(substr($value, 0, $size), '.');
break;


The mod uses "intval" and "floatval" to limit the users input to an integer or float, both of those commands do have issues with "0's". Its now on the to do list to find something fix these with.

tonnybarros, the mod not effecting a users post count is a known issue. Its been on the to do list for a while, even before I came to the team but we have yet to find the fix for it. We are looking though.

king kratos

Is there a way to add a captcha box to forms visible to guests?

Kratos

deciph3red

Quote from: king kratos on October 02, 2009, 12:13:49 PM
Is there a way to add a captcha box to forms visible to guests?

Kratos

I second this.

Garou

Capthcha is on the to do list I just haven't gotten to that yet.

Advertisement: