News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Custom Form Mod

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

Previous topic - Next topic

Nathaniel

I am more than happy to try to help you and explain anything that you do not understand.

The default form function looks like this:
// Generic template for showing the submit form page.
function form_template_submit_form()
{
   global $context, $txt, $settings, $scripturl;

   //   Starting text for the form and tables. Don't muck with this, unless you need to change the style!!!
   echo '
   <form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '">
      <table width="80%" border="0" cellspacing="0" cellpadding="0" class="tborder" align="center">
         <tr><td>
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
               <tr class="titlebg">
                  <td colspan="3">', $context['settings_title'], '</td>
               </tr>
               <tr class="windowbg2">
                  <td colspan="3"><br /></td>
               </tr>';
   
   //   Here you can add rows to the beginning of the table, if you want to...
   /*    Like this:
   echo '
               <tr class="windowbg2">'
                  New row.
               </tr>';
   */
   
   //   Documentation for the contents of each $field_data array, or entry into the $context['fields'] array.
   /*
   $field_name = The name of the field, straight from the value stored by the admin in the admin settings area;
    $field_data = array(
      'text' => This is the text which needs to be displayed next to the setting.,
      'type' => The type of input which the field is ,
      'value' => The value of the field, if this is not the first attempt at submitting the form,
      'data' => The list of options - only for the selection box type,
      'required' => A boolean value telling us wether or not its necessary to have a valid value for this field in order to submit the form,
      'failed' => A boolean value which tells us wether or not this field caused the form to fail to submit,
    );
   */
               
   // Now actually loop through all the variables.
   foreach ($context['fields'] as $field_name => $field_data)
   {
      //   Output the start of the row, as well as a spacer column.
      echo '
               <tr class="windowbg2">
                  <td class="windowbg2"></td>';
     
      //   Show the display text for this field.
      echo '
                  <td valign="top"><label for="', $field_name, '">', $field_data['text'], '</label></td>
                  <td class="windowbg2" width="50%">';

      // Show a check box?
      if ($field_data['type'] == 'checkbox')
         echo '
                     <input type="hidden" name="', $field_name, '" value="0" /><input type="checkbox" name="', $field_name, '" id="', $field_name, '" class="check" ', ($field_data['value']) ? 'checked="checked"' : '', '" />';
      // Show a selection box?
      elseif ($field_data['type'] == 'selectbox')
      {
         echo '
                     <select name="', $field_name, '">';
         foreach ($field_data['data'] as $option)
            echo '
                        <option value="', $option, '"', ($option == $field_data['value'] ? ' selected="selected"' : ''), '>', $option, '</option>';
         echo '
                     </select>';
      }
      // Large Text box?
      elseif ($field_data['type'] == 'largetextbox')
      {
         echo '
                     <textarea rows="4" cols="30" name="', $field_name, '">', $field_data['value'], '</textarea>';
      }
      // Int, Float or text box?
      else
         echo '
                     <input type="text" name="', $field_name, '" value="', $field_data['value'], '"/>';
     
      //   Show the 'required' asterix if necessary.
      if(!empty($field_data['required']))
         echo '
                     <div ', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>';     
     
      //   End the input column and the entire row.
      echo '
                  </td>
               </tr>';
   }
   
   //   Here you can add rows to the end of the form, if you want to...
   /*    Like this:
   echo '
                  <tr class="windowbg2">'
                     New row.
                  </tr>'
   */
   
   //   Show the "Required Fields" text down the bottom, show it in red if there was a failed submit.
   echo '
               <tr class="windowbg2">
                  <td colspan="3" style="text-align:center;', !empty($context['failed_form_submit']) ? 'color:#FF0000;' : '', '">
                     * ', $txt['CustomForm_required'], '
                  </td>
               </tr>';
   
   echo '
               <tr>
                  <td class="windowbg2" colspan="3" align="center" valign="middle"><input type="submit" value="', $txt['CustomForm_submit'], '" /></td>
               </tr>
            </table>
         </td></tr>
      </table>
      <input type="hidden" name="sc" value="', $context['session_id'], '" />
   </form>';
}


This is an example function of how you could do what you want:
Just replace the "This is some text at the beginning of the table." text with the text that you want and the "Text at the bottom of the form." text with the text that you want at the bottom of the form. To get this to be the template function for your form/s, all you need to do is put it into the 'CustomForm.template.php' file and then change the "test_form" part of the name to whatever you have put into the "Custom Form Template" setting for that form.
// Generic template for showing the submit form page.
function form_template_test_form()
{
    global $context, $txt, $settings, $scripturl;

    //    Starting text for the form and tables. Don't muck with this, unless you need to change the style!!!  ;)
    echo '
    <form action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '">
        <table width="80%" border="0" cellspacing="0" cellpadding="0" class="tborder" align="center">
            <tr><td>
                <table border="0" cellspacing="0" cellpadding="4" width="100%">
                    <tr class="titlebg">
                        <td colspan="3">', $context['settings_title'], '</td>
                    </tr>
                    <tr class="windowbg2">
                        <td colspan="3"><br /></td>
                    </tr>';
    echo '
                     <tr class="windowbg2">'
                         This is some text at the beginning of the table.
                     </tr>';
   
    //    Here you can add rows to the beginning of the table, if you want to...
    /*     Like this:
    echo '
                    <tr class="windowbg2">'
                        New row.
                    </tr>';
    */
   
    //    Documentation for the contents of each $field_data array, or entry into the $context['fields'] array.
    /*
    $field_name = The name of the field, straight from the value stored by the admin in the admin settings area;
     $field_data = array(
        'text' => This is the text which needs to be displayed next to the setting.,
        'type' => The type of input which the field is ,
        'value' => The value of the field, if this is not the first attempt at submitting the form,
        'data' => The list of options - only for the selection box type,
        'required' => A boolean value telling us wether or not its necessary to have a valid value for this field in order to submit the form,
        'failed' => A boolean value which tells us wether or not this field caused the form to fail to submit,
     );
    */
                   
    // Now actually loop through all the variables.
    foreach ($context['fields'] as $field_name => $field_data)
    {
        //    Output the start of the row, as well as a spacer column.
        echo '
                    <tr class="windowbg2">
                        <td class="windowbg2"></td>';
       
        //    Show the display text for this field.
        echo '
                        <td valign="top"><label for="', $field_name, '">', $field_data['text'], '</label></td>
                        <td class="windowbg2" width="50%">';

        // Show a check box?
        if ($field_data['type'] == 'checkbox')
            echo '
                            <input type="hidden" name="', $field_name, '" value="0" /><input type="checkbox" name="', $field_name, '" id="', $field_name, '" class="check" ', ($field_data['value']) ? 'checked="checked"' : '', '" />';
        // Show a selection box?
        elseif ($field_data['type'] == 'selectbox')
        {
            echo '
                            <select name="', $field_name, '">';
            foreach ($field_data['data'] as $option)
                echo '
                                <option value="', $option, '"', ($option == $field_data['value'] ? ' selected="selected"' : ''), '>', $option, '</option>';
            echo '
                            </select>';
        }
        // Large Text box?
        elseif ($field_data['type'] == 'largetextbox')
        {
            echo '
                            <textarea rows="4" cols="30" name="', $field_name, '">', $field_data['value'], '</textarea>';
        }
        // Int, Float or text box?
        else
            echo '
                            <input type="text" name="', $field_name, '" value="', $field_data['value'], '"/>';
       
        //    Show the 'required' asterix if necessary.
        if(!empty($field_data['required']))
            echo '
                            <div ', !empty($field_data['failed']) ? 'style="color:#FF0000;"' : '' ,'> *</div>';       
       
        //    End the input column and the entire row.
        echo '
                        </td>
                    </tr>';
    }
   
    //    Here you can add rows to the end of the form, if you want to...
    /*     Like this:
    echo '
                        <tr class="windowbg2">'
                            New row.
                        </tr>'
    */
    echo '
                         <tr class="windowbg2">'
                             Text at the bottom of the form.
                         </tr>'
   
    //    Show the "Required Fields" text down the bottom, show it in red if there was a failed submit.
    echo '
                    <tr class="windowbg2">
                        <td colspan="3" style="text-align:center;', !empty($context['failed_form_submit']) ? 'color:#FF0000;' : '', '">
                            * ', $txt['CustomForm_required'], '
                        </td>
                    </tr>';
   
    echo '
                    <tr>
                        <td class="windowbg2" colspan="3" align="center" valign="middle"><input type="submit" value="', $txt['CustomForm_submit'], '" /></td>
                    </tr>
                </table>
            </td></tr>
        </table>
        <input type="hidden" name="sc" value="', $context['session_id'], '" />
    </form>';
}


I have tried to make the function as simple and well-documented as possible, if you need any help with it then I am more than happy to offer some.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

tlknowles

Quote from: LHVWB on July 25, 2008, 02:09:24 AM

@Marduke,
You should not be able to post any HTML or bbc into the form, unless you have put 'parse_bbc' into the "Extra Type Parameters" setting. I will have to investigate the issue of html and bbc, because at the moment no HTML should be allowed through. Could you please tell me what settings you put for the field which allows html?

I'm not Marduke...but I have used html tags in the Text field with no apparent problems.
It displays as I intended it to display.

Custom Form Mod Settings -> "Review Form" Form -> "rev_details" Field
Title   [ bk_review ] field name
Text   [ <b>My Review</b><br />Tell us what you thought of your latest read. ] Displayed Text
Type  [ Large ( Multiline ) Text Box ] Input field type
Extra Type Parameters   [ empty ]

Then...on the form...NOT the form output...
The display looks like this:

My Review
Tell us what you thought of your latest read.


I was under the impression that the [ parse_bbc ] entered into the Extra Type Parameters option would allow posters to use bbc on their input.
...no?

tlknowles
Current Installation
SMF 1.1.4 >> SMF 1.1.5 ( Default Theme )

Nathaniel

@tlknowles,
I can see that I probably misinterpreted what you were talking about, you are right there is no reason why html and bbc won't work for the output post that you can create, and the text setting for each field. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

tlknowles

[gush]

This is a SUPER mod!
It's going to make my life so much easier.
I am SOOOO pleased with the flexibility and operation!
I can't imagine any forum that couldn't use it.

LHVWB...
If you won't tell us how to donate to you - for your hard work - in the thread...please send me a private message with the inforomation.

[/gush]

Thanks again.
tlknowles
Current Installation
SMF 1.1.4 >> SMF 1.1.5 ( Default Theme )

Nathaniel

I'll try to set up a paypal account and make a donations page on one of my demo sites sometime... ;)

I kind of made this and the other mods I've been working on for experience and fun, but I am happy to accept donations. I'll just have to set up a system. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

digit

Quote from: LHVWB on July 25, 2008, 05:37:41 AM
I'll try to set up a paypal account and make a donations page on one of my demo sites sometime... ;)

I kind of made this and the other mods I've been working on for experience and fun, but I am happy to accept donations. I'll just have to set up a system. ;)

Cool - 'looking forward to taking a peek at your custom menu mod too!

I stopped using the SMF menu a LONG time ago in favor of my own

that just does...

if logged in... echo
if group.... echo
if admin...  echo

I also do that with a custom pull down menu ;)

some type of form for that would be way cool though!
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

Nathaniel

@digit,
Yeah, that mod.... I sort of went insane and worked on it for about a week and a half last semester (starting again from stratch) and then I stopped, and created the SMF 2 Beta version of this mod, as well as a few other mods, and now I have started a few other mods. So it may take a while to finish the Custom Menu Mod, and when I do. Unfortunately it will only be for SMF 2 Beta, unless I go completely insane and port it back, but its unlikely at this stage. ;)

I think the main problem with that mod is that I've it way too complicated, it has several thousand lines of code and allows you to create entire new menu systems complete with submenus, popup menus/subbuttons (if your template allows it) and etc. To the stage where it might be easier for a user to set up their own system, by change SMF code, than trying to use the mod. ;D
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Nathaniel

Okay, I have now finally managed to update the SMF 2 Beta version so that it has the v1.1 features of this mod. It only ended up taking me a few hours, because there wasn't much to change, and any issues had already been worked out for the SMF 1.1.5 version.

Mod Changes v1.1 SMF 2 Beta:
Added the new custom template stuff.
Some minor bugfixes.

I will now consider any ideas/suggestions that I have been given and think about wether or not I need to create another version of this mod, although at the moment I am going to concentraite on supporting this mod and creating a few new ones.

Thank you,
LHVWB

SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

erlend_sh

QuoteTable 'radakano_main.smf_smf_cf_forms' doesn't exist
File: /home/radakano/public_html/forums/Packages/temp/install.php
Line: 45
Installing on default theme, no problems with earlier mods. Anyone else getting this with 2.0?

Nathaniel

I have tried it on some clean versions and I have been unable to get this error.

Maybe you should try to do the Database stuff manually. If you still have all your database stuff there then you should be able to just add a 'template_function' column with type 'tinytext' and then maybe the error will stop... ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

4b11l

@LHVWB,

Thanks for the example!

I just want to point out just in case so it wont happen to anyone that is in my situation. In the CustomForm.template.php, the documentation for adding the new row is wrong. There should be no apostrophe directly following the > in the tr tag. The only one that should exist is after the tr closing tag.

So, as of right now, it looks like this:
echo '
<tr class="windowbg2">'
New row.
</tr>';


However, it should be like this:
echo '
<tr class="windowbg2">
New row.
</tr>';


Thanks for all the hard work!

Nathaniel

@4b11l,
Thanks for pointing that out, I had actually realised that when I made the 1.1 version for SMF 2 Beta, but I didn't think it was worth releasing another version of the SMF 1.1.5 version of the mod just to fix up that documentation. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Sudhakar Arjunan

Hi LHVWB,

A Simple suggestion.

I use dilber mc , if you kinly help me creating one custom.template which i could use in the form .

I appreciate it.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Nathaniel

Quote from: asudhakar on July 27, 2008, 08:12:50 AM
Hi LHVWB,

A Simple suggestion.

I use dilber mc , if you kinly help me creating one custom.template which i could use in the form .

I appreciate it.

I don't have much time just at the moment, but I will have a look at the templates and then get back to you sometime in the next day or two. :)

I have worked with that template, and I am more that happy to do some more work with it. So you need a custom form template or one for the forms list?
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Lady Night Owl

#134
Quote from: tlknowles on July 24, 2008, 09:29:28 PM
FOUND IT!

Would you mind sharing what you found, please, as it seems that I'm running into the same problem that you were.

I keep getting this at the end of the address when I submit the form:

index.php?action=form;id=1;submit;

I doesn't redirect me to the designated board (and the ID is correct) after I fill out the form.
Running SMF 2.0.1

tlknowles

#135
Quote from: Lady Night Owl on July 27, 2008, 03:47:09 PM
Quote from: tlknowles on July 24, 2008, 09:29:28 PM
FOUND IT!

Would you mind sharing what you found, please, as it seems that I'm running into the same problem that you were.

Yeah...no sweat.

The problem I was having was...
...after I created a form...saved it...and tried to display it...I couldn't find the form.
I was under the impression that the form would be the message format for a particular board.
It is not.

The completed forms are presented in a separate list of available forms.
Your forum members can select the appropriate form...and when it is saved to the forum, it is saved to the board you selected on the saved form.

I found my answer in an eariler answer LHVWB ( mod author ) left for Cybertec.

Quote@ Cybertec,
I am not entirely sure what you are talking about, but I am going to add more documentation to the downloads page so hopefully that will explain everything. To post a form, you need to access it from the index.php?action=form, also remember that the form settings in the admin area have to be done properly, ie. the board id has to be valid, there have to be fields in the form and etc.

So...in my case...which is probably different than your case.
SMF is in a directory on my server called "4um" ( not in my root directory )
I have to call the list of forms with
http://www.mysite.com/4um/index.php?action=form

If your forum is in your root directory...your link will look like this :: http://www.mysite.com/index.php?action=form

Of course..."mysite.com" would be replaced with your site information.

You could program a button to pull up the list.

I am using User Control Panel By Alan S 2.0, and have programmed a section of the resulting USER CP to bring up the list for my members.

Hope this helps.

tlknowles
Current Installation
SMF 1.1.4 >> SMF 1.1.5 ( Default Theme )

Lady Night Owl

#136
Thank you :)

My forum isn't in my root directory ;) Unfortunately, I think you're right that our issues are different.
I do have the user control panel installed, so when/if I can get this mod to work, I'll have to add a button in there for the users.

I can only get the form to post the answers to the designated board if I enter numbers (like 1234) in the text box. It won't post the answers if I enter my user name (no matter if I choose 'string', 'float' or 'integer'). The same thing happens if I use the multi-line text box. I'm not a coding expert, so I don't know which one I should choose. According to some things I looked up, I should be using 'string' if I want someone to enter their username, for example.

The same thing happened on the demo site, but I thought it might have just be the settings which I have no control over on there. I can enter words in the text box, but not the multi-line (only numbers).




The other problem I'm having is with selection boxes. How do I make them a 'required' field without making "Required" an option for people to select? Maybe the required option should have to be included in the extra parameters, but you could add a check mark to the 'add new field' part. If checked, that field will be required.
Running SMF 2.0.1

tlknowles

@ Lady Night Owl

Well...let's start at the beginning.
Go to Admin >> Features & Options >> Custom Forms ( tab ).
1) In the Custom Form Mod Settings box, select the  [ Select permissions for each group ]  link to set permissions for those groups that can see/use all the forms you create.
2) Create a title in the View Forms Title box. ( This is displayed at the top of the form list. )
3) Create a description of the list in the View Forms Text box. ( This is displayed below the title of the list. )

Then...click the Add New Form at the bottom of the Custom Forms below the Custom Form Mod Settings box.
Don't worry about the Custom Form Mod Settings -> "" Form box yet. This is for the form output. And you can't create this until you have all the fields created.

Scroll down to the Form Fields box...and click the Add New Field option so we can create a few simple fields to show you how it works.

Add New Field results in a box titled Custom Form Mod Settings -> "" Form -> "" FieldThese are blank right now because a) the form has no name yet...and b) the field has no name yet.

Ok...
Now...enter the following
Title  [name]
Text  [Enter A Name]
Type  [Text Box (String)] Leave this default option to create a single line text box.
Extra Type Parameters [ ---  empty --- ] This is where you would enter the word required if you wanted to make it a required field.

Then...Save.

Create another field :: Click Add New Field
Title  [weather]
Text  [What's the weather like today?]
Type  [Large (Multiline) Text Box]
Extra Type Parameters [ -- empty -- Not sure what parameters would be needed for this option...but I suppose there are some I don't know about...or haven't thought about.

Type  [Large (Multiline) Text box] creates a user box that will allow for longer strings/entries, and display accordingly. It's just a bigger single-line text box.

Then...Save.

Next field :: Click Add New Field
Title  [kansas]
Text  [Click the box if you live in Kansas]
Type  [Check Box]
Extra Type Parameters [ --- empty --- ] This is where you would enter the word required if you wanted to make it a required field.

Type  [Check Box] creates one check-box per field.
You don't have the option to create a list of check boxes for this one field.
It's either on ( checked ) or off ( not checked ).
The way you word the field Text will determine whether you want to see the box checked or not checked.
For example ::
If I enter into the Text box :: [If you read the registration agreement, check the box.]
I will want the user to check the box for yes, and leave it blank for no.

Ok...SAVE again.


Next field :: Click Add New Field
Title   [favorite]
Text   [Pick your favorite type of weather.]
Type  [Selection Box]  Creates a drop down selection box. User highlights their choice.
Extra Type Parameters [-- Select One -- ,Rainning ,Snowing ,Sunny ,Windy ,Hurricane ]

Extra Type Parameters
You can't use commas in your selection options.
The commas seperate the options shown.
So...if you use commas in your options, it will break the line on the selection list.
For example ::
If I tried to enter an option something like this ::
I like sunny days, with lots of wind, so I can fly kites.
It would display like this ::
I like sunny days ( an option )
with lots of sun ( another option )
so I can fly kites. ( another option )

Ok...SAVE again.

I'm not going to go into Text Box (Float) or Text Box (Integer) because I don't fully understand these options yet. I do know Text Box (Integer) probably restricts the entry to numbers. But, Text Box (Float) is foriegn to me at this time.

All righty!
Now...you should be back at the Form Output screen.
And...your saved form fields should be listed below the blank form.

Custom Form Mod Settings -> "" Form
Your form still doesn't have a name, so "" is still empty.

1. Enter a name for your form.
Title [ My Weather Test Form ]

2. Tell the Mod(ification) which board to save the results to.
Board ID [ XXX ] XXX will be the board ID number.
A quick way to determine the board number is to open the intended board in your browser.
The browser address bar will display something like :: http://www.mysite.com/index.php?board=5.0
The board ID is the number at the end of the URL :: 5.0
It's going to be different in your case.

You can leave this blank until you know which board to save to.
If you want to go create a test board for the results...save before leaving the screen.

3. Name your customize template.
Custom Template Function
Sorry...you'll need to seek help on this option from one who knows more about it than me.

4. Make your permission choices.
Permissions  [ Select permissions for each group ]
Pick the groups that can use the form.

5. Create a Subject line that will be displayed when the results are submitted.
Subject [ --- whatever you like - including saved fields --- ]
You can use your saved fields in the Subject line, which, could make finding the result you want much faster.
You'll have to think aboutthis.
But never fear. You can always go back and EDIT the Form / Form Output / Form Fields.

6. Create the way you want the results to be displayed.
Form Output: Let's keep this simple for this example.
In the edit box...enter the following ::

Survey answered by :: {name}

Today, their weather is :: {weather}

Lives in Kansas :: {kansas}

Their favorite weather is :: {favorite}

And SAVE.

...come back to the form and change the board number when you know the correct board ID.

Now! Pull up your list of forms with
http://www.mysite.com/index.php?action=form

Fill out your form.
Save.
Go to the board where you told the Mod(ification) to save it.
And view the results of your good work.

I hope this helps.
This mod(ification) is really very useful.
And very easy to use once you get started.

tlknowles
Current Installation
SMF 1.1.4 >> SMF 1.1.5 ( Default Theme )

Lady Night Owl

#138
Wow! What I'm having trouble with is getting TEXT to go through. I can create the form and all just fine. Sorry to have wasted your time with the explanation, I do appreciate you trying to help. :(

The information gets posted to the board just fine, but only if I enter numbers - and this is after I've chosen 'text (string)'.

For example - let's fill out the little fake form I've created:

First field [name] {is set to text box (string)} << I can't enter a name!

It won't submit the information to the specified board. However, if I enter '1234' it submits and posts. Same goes for the multi-line text box. I can only enter numbers if I want it to work.

On the demo site, text works in the text box field, but it does not for the multi-line text box - I have to enter numbers there as well. If that were really a support ticket, I would be one frustrated member because I couldn't give details on the problem. I'd end up private messaging instead.

So what am I doing wrong on my text box fields? As I said, I'm selecting 'string', and it seems that there is some technical difficulty with the multi-line box on my site as well as the demo site. Some error in the file code maybe?

Now the selection drop down:

Say I want to make this a required field (I wouldn't really for this example lol, but just to show)...in the extra parameters box, I have to enter [Story A, Story B, required] So, "required" is going to show up as an option to be selected for the person who is filling out the form. How do we get around this? Because as it is, unless I'm doing something wrong, it would look like this:

Which story was your favorite?
Option 1  [Story A]
Option 2 [Story B]
Option 3 [required] << :(

This is a very useful mod, but I can't use it if I have to enter numbers where numbers shouldn't be - like it text fields that are intended for letters. Know what I mean?
Running SMF 2.0.1

Nathaniel

@asudhakar,
I have looked over the templates and how they work the Dilber MC theme, I am happy to help you to create a custom template if you need one, but I will need some more information. Do you want a new template for a custom form or a new template for the forms list? With either it would be nice to either have a detailed explanation of what you want, or an image demonstraiting it.

@Lady Night Owl,
Okay I will try to answer your questions systematically.

Selectbox problem:
The reason that you can't put 'required' into a selectbox its because they are always 'required', when you are submitting a form, even if you don't touch the selectbox, it will return the value for the first option in the selectbox. Because of this, its not necessary to make them required, the system actually checks to make sure that they are always there. I did it like that, because you might want to use the string 'Required' as one of your options in the selectbox.

I am considering that there should be separate fields for required, parse_bbc and etc. because that would avoid making it unclear, but for the moment I am going to leave it.

Multi-line text box issue:
Okay, I can see the problem, its definetly there and its really odd. I am going to investigate this issue and fix it ASAP. I still don't know why its happening, but I will try to keep you informed. I aggree that the error is totally unacceptable, I am just sorry that I haven't had much time lately, so I haven't picked up on this earlier.  :(

Thank you,
LHVWB

SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Advertisement: