News:

Wondering if this will always be free?  See why free is better.

Main Menu

Custom Form Mod

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

Previous topic - Next topic

Nvb

I have added my form for you to test.
It works fine here.
Be sure to add it under your Sources directory.

Garou

Comparing your file to mine, yours reads...

if(($size != ''))
$value = substr($value, 0, $size);
}
}

                        //   Do we have an invalid value? Is this field required?
            if(($required
            && (($value == '') || ($value == '0'))
            && ($field['type'] != 'checkbox'))


And mine reads as...
// if(($size != ''))
// $value = substr($value, 0, $size);
}
}

// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == '0'))
&& ($field['type'] != 'checkbox'))


Hope that helps  :)

MrMusic

Quote from: Garou on December 18, 2008, 11:42:16 PM
Comparing your file to mine, yours reads...

if(($size != ''))
$value = substr($value, 0, $size);
}
}

                        //   Do we have an invalid value? Is this field required?
            if(($required
            && (($value == '') || ($value == '0'))
            && ($field['type'] != 'checkbox'))


And mine reads as...
// if(($size != ''))
// $value = substr($value, 0, $size);
}
}

// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == '0'))
&& ($field['type'] != 'checkbox'))


Hope that helps  :)

Ok, I have tried every suggestion that has been put on this forum so far. Nothing has changed.

Now, I am new to all this so I am not sure that I am applying everything properly.

First, I applied the changes to the CustomForm.php in my CFM folder. It did not work.
Then, I noticed that there was another CustomForm.php in my Sources folder as suggested in one of the posts above. I applied the changes there, nothing.

So, now I am getting desperate. I really need this to start working. I have a strong need for it's use and do not know of any other alternative.

Are there any other suggestions on how I can get this operating.

I know your time is valuable and any help is truly appreciated.

Ashley

Garou

#383
Um there should only be one CustomForm.php file. It should be in your Sources directory.
Then there should be a CustomForm.template.php in the default theme directory. Since your using a custom theme you may need to put it there too but try it without first.

Check out the manual install instructions for the mod, compare it to your files and make sure it matches.
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1279;attach=62066;smf_version=1.1.5

Also are you using the most recent version? LHVWB hasnt put it on the downloads page, he just attached it to a post here and the file can be found here.

You are right though there isn't an alternative to this mod. There is the custom pre-filled post hack by Thurnok on Tiny portals site but after using this mod for a while I just really cant recommend it any more.

Garou

It looks like MrMusic's Problem is solved.

The problem wasn't in the Mod but in the syntax of the questions asked.

The "title" for the questions works better when small case is used and there are no spaces. The "text" section is the way you want it to look in your form. Also in the Post output section, you need to format the form input to match the "title".

For instance if you want to use "Your Name" as a question you would need to format it as...

Title                                              your_name
Text                                              Your Name
Type                                             Text Box (String)
Extra Type Parameters                    required


Then in the Form Output section you would use
My name is: {your_name}

In the actual form people fill out you would see...
Your Name                                        Garou

Then when the message is posted to your board you would see...
My name is: Garou

Swayforth

Hello all,

First i must say this is one awesome mod!

i have been having an issue with the required fields and have narrowed it down to this.

When i make a required field and the input is numeric only i receive no errors.
When i make a required field and the input is alphabetical i do receive the error.

So my question is this, what in the code could cause this issue? I wish i could be of more help but i do not know how to code i only know how to narrow down the issue. Thanks all!!!

The attached images explained
1st image - required_error_abc_name.jpg = All required fileds but the Name file is numeric
2ns image - required_error_abc_forum_name.jpg All required fileds but the Forum Name file is numeric
no setting changes were done between the 2 tests, just the input was changed.



Garou


Swayforth

Sorry Garou i should have specified that i applied that fix before post and i should have attached the file as well.

I did spend some time on this thread looking for answers :) Just seems odd that only numbers are working. We sure it's not some type of formatting only allowing numeric input?

Thanks for the reply


// Restrict the length of value if necessary, can stuff up html, but hey...
if(($size != ''))
$value = substr($value, 0, $size);
}
}

// Do we have an invalid value? Is this field required?
if(($required
&& (($value == '') || ($value == '0'))
&& ($field['type'] != 'checkbox'))
// Failing for selectboxes is far more simple, If there is no valid value, it fails.
|| (($field['type'] == 'selectbox') && ($value == '')))



Garou

Have you checked the syntax of the titles field when you create a form? That can also cause errors. For instance the title should be something like "member_name", "name" or "membername" and not "Member Name" or "Name". For some reason the form doesn't like large case letters and spaces in the title, that was the problem MrMusic ran in to a few posts back but I bet you read that already too. :)

Those are the only two problems Ive found that cause the required fields errors. The only other thing I can think of is if you tried to create a custom template and did something wrong in there.

Swayforth

Yes sir, i read that as well. i even created a new form with everything lowercase no spaces with only 1 field and still am seeing the issue(see attached). I am not running a custom template either. I have taken the original files and moved them to my theme folder. i did have to do a manual install. perhaps somewhere in the manual install something is wrong?

im running
1.1.7 + Tiny Portal 1.0.6 beta2
Black-Rain V2 by Crip theme.



Garou

It shouldn't effect anything as SMF should just pull it from the default directory but have you tried copying the CustomForm.template.php to your Themes/Black-Rain folder?

After you have done that and if it still doesn't work then all I can suggest is uninstalling everything and then reinstall with errors and manually change the files that have errors. That way there is less chance for typo errors. 

Propaganistas

Hello,

I'm getting this error when trying to submit a form. I'm using the updated version previously attached to one of the posts, all form names are lower case and without any spaces, CustomForm.template.php is also copied to my custom theme,...

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'gwbbcode';/*
*/ /*
*/ /* Include the overDiv div *//*
*/ var overdiv_div =' at line 4
File: /home/ecto.nl/www/forum/Sources/Subs-Post.php
Line: 1542

gwBBCode is a mod which adds a lot of new bbcode and functions..

My Subs-Post.php file is in attachment.

Thanks in advance,
Propa

Garou

Propaganistas I know nothing about gwBBCode and after a peek at it, the problem could easily be that it was never properly ported over for SMF. Someone just kinda hacked at it till they got most of what they wanted from it and then left it at that. I found a post on here about it asking for someone to make a real SMF mod out of it but it looks like no one ever did.

Essentially what your working with is a hack and not a mod, sometimes they work and sometimes they don't. 

I looked at your Subs-Post.php file and I cant find the error. Line 1542 doesn't look like its causing the problem and the code listed in the error isn't even in the file at all.

I think you might be better off taking the problem to someone more familiar with SMF and gwBBCode. They will most likely be able to spot something in the hack that I can not. Maybe someone else here might have more luck with it but I'm at a loss.

Propaganistas

Ok thanks for your reply Garou!

~Propa

tsmalmbe

Is this mod still alive? I would require attachments for this to be of use.

It installed correctly on 1.1.7, althouhg I had to add some things by hand to modsettings.

Anyway, default values do not seem to work, and if I mark something as required, the form does not submit regardless of if I put a value in the required field or not.
..:: http://www.kontrollrummet.com - Studio och musik ::.. RSS?

Nvb

Quote from: tsmalmbe on January 02, 2009, 07:01:34 AM
Anyway, default values do not seem to work, and if I mark something as required, the form does not submit regardless of if I put a value in the required field or not.

Omg! did you read this topic? look at the top of this page to find the solution for this great mod.
Hint: it has something to do with "".... :P

gadgetfl

Feature Request:
Email Notification on form submit.

The "notify" feature of SMF would be fine but the form save bypasses it by directly writing to SQL DB


tonyluzzi

I am using No Spam by Guests! which blocks Guests from making posts with links in them. However, I noticed when I made a form post, the links still went through.  Is there a way of combining these 2 mods so that they can submit a form only if it doesn't contain any links?


happyfeet

Does anyone have any experience integrating reCaptcha into the custom form mod?

reCaptcha for PHP information can be viewed here:

http://recaptcha.net/plugins/php/ [nofollow]

I am looking at what it would take to integrate this into the custom form I created with this mod and am looking for some advice.

Thanks!

Advertisement: