The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

how to create inputs in new topic form page ?

View previous topic View next topic Go down

In progress how to create inputs in new topic form page ?

Post by bodahassan on August 27th 2016, 11:44 pm

Technical Details


Forum version : #phpBB3
Position : Founder
Concerned browser(s) : Mozilla Firefox
Screenshot of problem : http://i35.servimg.com/u/f35/13/76/93/58/post_a10.png
Who the problem concerns : Yourself
Forum link : http://sd.koutstore.com/h9-page

Description of problem

Good evening

i want to create inputs such as support forum but i don't know how it can be done

I found a simple HTML page, now I want to add some inputss to appear in the topic such as the exact support forum

Code:
        <form enctype="multipart/form-data" name="post" method="post" action="/post">
          <div class="panel">
            <fieldset>
              <dl>
                <dt><label>Select Forum :</label></dt>
                <dd>
                  <select name="f">
                    <option value="1">Forum 1</option>
                    <option value="2">Forum 2</option>
                    <option value="3">Forum 3</option>
                  </select>
                </dd>
              </dl>
           
              <dl>
                <dt><label>Topic title :</label></dt>
                <dd><input type="text" name="subject" class="inputbox medium"/></dd>
              </dl>
           
              <dl>
                <dt><label>Message :</label></dt>
                <dd><textarea id="text_editor_textarea" name="message"></textarea></dd>
              </dl>
           
              <div style="text-align:center;">
                <input class="button1" name="post" value="Send" type="submit"/>
                <input name="mode" value="newtopic" type="hidden"/>
              </div>
            </fieldset>
          </div>
        </form>

avatar
bodahassan
Forumember

Posts : 35
Reputation : 1
Language : arabic

http://www.koutstore.com

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by bodahassan on August 28th 2016, 8:16 pm

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
avatar
bodahassan
Forumember

Posts : 35
Reputation : 1
Language : arabic

http://www.koutstore.com

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by SLGray on August 28th 2016, 8:17 pm

Yesterday at 4:44 pm
Today at 1:16 pm

Second Reminder:
Please don't double post. Your posts need to be separated by 24 hours before bumping. Please use the edit button, instead!

Please read our forum rules: ESF General Rules


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 40206
Reputation : 2716
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by Luffy on August 28th 2016, 10:13 pm

Hello @bodahassan,

To add new inputs to your form you need to add this code:
Code:
<dl>
  <dt><label>FIELD NAME HERE :</label></dt>
  <dd><input type="text" name="something" class="inputbox medium"/></dd>
</dl>

This will add a new input to your form. You can copy paste any field you want in your form and add it again and again as many times as you want. Smile





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by bodahassan on August 28th 2016, 11:01 pm

Thank you @Luffy but you didn't understand my question

I want the input appear in topic like support forum



I think inputs also need to JavaScript code

Because if you add inputs to the form it will not show up in the topic because it is not within the textarea
avatar
bodahassan
Forumember

Posts : 35
Reputation : 1
Language : arabic

http://www.koutstore.com

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by Luffy on August 28th 2016, 11:21 pm

Well at first you need to create a form based on what you want the form to have in.
Afterwards you need to add each input and each part of that form some specific and different ID's so that with the javascript code it will grab them, add them to the editor and automatically post it like here. A small example of what i am saying is this one:

Code:
<form id="pm-form">
  <fieldset style="border:none;">    </fieldset>               
  <div class="input1">
    <div class="inputTitle">
    Field 1:
    </div>
    <input id="input1" type="text" />                                     
  </div>   
 
  <input id="topicTitle" type="text" name="subject" value="Topic Title" style="display:none;" /> 
  <textarea id="editorID" name="message" style="display:none;"></textarea>                                 
</form>
<div style="border: none;">                             
  <input type="submit" name="post" id="sendButton" value="Submit" />                   
</div>

<script>
            document.getElementById('sendButton').onclick = function() {
              // define your variables !
              var message = document.getElementById('editorID'),
                  input1 = document.getElementById('input1');
 
              // generate error mesage for each required field
              if (!input1.value) err += 'Please complete all fields.';
       
              if (err) {
                alert(err); // return error message
                return false; // stop event propagation
              }
           
              message.value = 'This is the input value:' + input1.value;
       
            };
            </script>
            </div>





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by bodahassan on August 28th 2016, 11:45 pm

Thank you so much @Luffy
I tried to work on the example but it didn't work with me
Content input did not appear in topic

Code:
                  <form enctype="multipart/form-data" name="post" method="post" action="/post">
                  <div class="panel">
                    <fieldset>
                      <dl>
                        <dt><label>Select Forum :</label></dt>
                        <dd>
                          <select name="f">
                            <option value="1">Forum 1</option>
                            <option value="2">Forum 2</option>
                            <option value="3">Forum 3</option>
                          </select>
                        </dd>
                      </dl>

                      <dl>
                        <dt><label>Topic title :</label></dt>
                        <dd><input type="text" name="subject" class="inputbox medium"/></dd>
                      </dl>
                          <div class="input1">
            <input id="input1" type="text" />                                   
        </div>
                      <dl>
                        <dt><label>Message :</label></dt>
                        <dd><textarea id="text_editor_textarea" name="message"></textarea></dd>
                      </dl>
                 
                      <div style="text-align:center;">
            <input type="submit" name="post" id="sendButton" value="Submit" />                 
                        <input name="mode" value="newtopic" type="hidden"/>
                      </div>
                    </fieldset>
                  </div>
                </form>
 
       
           
    <script>
        document.getElementById('sendButton').onclick = function() {
          // define your variables !
          var message = document.getElementById('text_editor_textarea'),
              input1 = document.getElementById('input1');

          // generate error mesage for each required field
          if (!input1.value) err += 'Please complete all fields.';

          if (err) {
            alert(err); // return error message
            return false; // stop event propagation
          }

          message.value = 'This is the input value:' + input1.value;

        };
    </script>
avatar
bodahassan
Forumember

Posts : 35
Reputation : 1
Language : arabic

http://www.koutstore.com

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by Luffy on August 28th 2016, 11:48 pm

@bodahassan that's because your textarea element has different ID with the one you have on your script.

Try changing the
Code:
editorID
in your script with this one:
Code:
text_editor_textarea





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by bodahassan on August 28th 2016, 11:54 pm

@luffy I'm sure I've changed the editorID id

see :
Code:
                          <form enctype="multipart/form-data" name="post" method="post" action="/post">
                          <div class="panel">
                            <fieldset>
                              <dl>
                                <dt><label>Select Forum :</label></dt>
                                <dd>
                                  <select name="f">
                                    <option value="1">Forum 1</option>
                                    <option value="2">Forum 2</option>
                                    <option value="3">Forum 3</option>
                                  </select>
                                </dd>
                              </dl>
       
                              <dl>
                                <dt><label>Topic title :</label></dt>
                                <dd><input type="text" name="subject" class="inputbox medium"/></dd>
                              </dl>
                                  <div class="input1">
                    <input id="input1" type="text" />                                 
                </div>
                              <dl>
                                <dt><label>Message :</label></dt>
                                <dd><textarea id="text_editor_textarea" name="message"></textarea></dd>
                              </dl>
                       
                              <div style="text-align:center;">
                    <input type="submit" name="post" id="sendButton" value="Submit" />               
                                <input name="mode" value="newtopic" type="hidden"/>
                              </div>
                            </fieldset>
                          </div>
                        </form>
       
             
                 
            <script>
                document.getElementById('sendButton').onclick = function() {
                  // define your variables !
                  var message = document.getElementById('text_editor_textarea'),
                      input1 = document.getElementById('input1');
       
                  // generate error mesage for each required field
                  if (!input1.value) err += 'Please complete all fields.';
       
                  if (err) {
                    alert(err); // return error message
                    return false; // stop event propagation
                  }
       
                  message.value = 'This is the input value:' + input1.value;
       
                };
            </script>
avatar
bodahassan
Forumember

Posts : 35
Reputation : 1
Language : arabic

http://www.koutstore.com

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by bodahassan on August 30th 2016, 9:22 pm

Bumps !!! Think

@Ange Tuteur Please help me to solve the problem, It's very important to me
avatar
bodahassan
Forumember

Posts : 35
Reputation : 1
Language : arabic

http://www.koutstore.com

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by bodahassan on September 1st 2016, 11:24 pm

Bumps Bumps Bumps Bumps Bumps Bumps Bumps !!!!!!!!!!!!!!

I need quick response please
avatar
bodahassan
Forumember

Posts : 35
Reputation : 1
Language : arabic

http://www.koutstore.com

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by bodahassan on September 4th 2016, 12:29 am

Where the support team, what all this carelessness !!!!!!!!!!!!!!!!

5 days and did not solve the problem

And if the support team is not qualified to answer queries and issues of Members why if they are within the staff
avatar
bodahassan
Forumember

Posts : 35
Reputation : 1
Language : arabic

http://www.koutstore.com

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by SLGray on September 4th 2016, 4:10 am

Please don't use bold or color and keep to the default text. This is reserved for the staff for moderation. Thank you.
Please read our forum rules: ESF General Rules


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 40206
Reputation : 2716
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: how to create inputs in new topic form page ?

Post by Luffy on September 4th 2016, 3:30 pm

@bodahassan staff members are volunteers. They are not forced to be here. They volunteer to help as much as they can. Some are not so good at coding. Some are. But firstly they are all human and they have problems and needs in their real lives. We cannot force them to come here and help everytime someone has a problem. We are here to help when we can and where we can. So please be patient and your problem will be solved sooner or later.

Now, have you checked that the security feature that will allow you to post is turned off?
To check that go to: Admin Panel > General > Forum > Security > Unauthorize unofficial forms to post messages and private messages on the forum : (set to) No

Thanks! :rose:





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum