HomeHome  
  • WelcomeWelcome  
  • Events  
  • PublicationsPublications  
  • FAQFAQ  
  • SearchSearch  
  • MemberlistMemberlist  
  • UsergroupsUsergroups  
  • RegisterRegister  
  • Log inLog in  
  • You are not connected. Please login or register


    Form Submission to Thread Formatting and Coding Help

    avatar
    • ***


        Reputation : 1
        Registered on : 2013-08-31
        Posts : 26
        LG
      I found a code to let you submit a form via an HTML page that will create a thread in a specified Forum Section. However this code was created to help 1 person specifically, thus it does not do what I need it to do for me.

      Code:
      Code:
      <form enctype="multipart/form-data" onsubmit="return vB_Editor['text_editor'].prepare_submit(0,0);" name="post" method="post" action="/post?f=7&mode=newtopic" target="_blank">
          Subject: <input class="inputbox medium" size="30" type="text" value="" value="" name="subject" id="subject" readonly><br /><br />
          <span class="app-field">
          Question 1: <div class="answer"><input type="text" /></div><br />
          Question 2: <div class="answer"><input type="text" /></div><br />
          </span>
          <input type="button" value="Undo Application" onClick="redoapp()" /> <input type="button" value="Update Application" onClick="updateapp()" /><br /><br />
          Final Application:<br /><textarea id="text_editor_textarea" class="inputbox" wrap="virtual" onselect="storeCaret(this)" tabindex="3" name="message" onkeyup="storeCaret(this)" onclick="storeCaret(this)" readonly></textarea><br /><br /><span style="display:none;" id="auths"></span><input class="button1" type="submit" accesskey="s" tabindex="6" value="Submit Application" name="post" id="subButton"></form>
          <script type="text/javascript">
      $('#auths').load(''+document.forms['post'].action+' input[type="hidden"]');
      document.getElementById('subject').value = "::PENDING - "+document.getElementById('appUserName').innerHTML;
      function updateapp() {
      var answers = document.getElementsByClassName('answer');
      for (i = 0; i<answers.length; i++) {
      answers[i].innerHTML = answers[i].firstChild.value;
      }
      document.getElementById('text_editor_textarea').value = document.getElementsByClassName('app-field')[0].textContent;
      }

      function redoapp() {
      var answers = document.getElementsByClassName('answer');
      for (i = 0; i<answers.length; i++) {
      answers[i].innerHTML = "<input type='text' value='"+answers[i].innerHTML+"' />";
      }
      }
          </script>

      Okay. Now what I want it to do. Which im not 100% sure is possible yet lol.

      What I want coded (which I am terrible at):
      The form -
      I know how to code the form in terms of CSS and HTML. However I am not 100% on all the javascript which is used to make things happen! I have been playing with the code above to try and get different results but I am really struggling. I can get the image below coded to look like that. I can get the form to submit to a Topic.


      Here is the tricky part. I need to have the form submit MULTIPLE form inputs into the Subject line of the topic. And I would hopefully like to format it.


      I can probably figure out the coding to format it (which will obviously just be css). I can format the rest of the topic list. But I am having a terrible time trying to get the multiple parts of the form to all submit to the Subject of the Thread.

      So you can see from the image above, I want "Username"(which is a text input so the user can type anything there), "Platform"(Predefined Dropdown List), "Game or Primary Game"(Predefined Dropdown List), and the "Location"(Predefined Dropdown List) to all be inserted into the Subject line of the Thread that gets created. And I want to format each of them with a different color.

      Then the other 2 fields, "Microphone"(Predefined Dropdown List), and "Biography"(Text Area) to be inserted into the Body of the Thread as the Message. Preferably with a style as well that looks similar to the image below:



      Phew.

      I cannot tell if I am asking a LOT of work here, or if its just a basic switch of coding from the earlier code I posted.

      You do not have to do any of the formatting css, jsut add the selector(class or ID) and ill code it myself.

      Thanks a ton for all this help. If all goes smooth i'll give credit to FMCodes for making this work for me.

      avatar
      • ***


          Reputation : 1
          Registered on : 2013-08-31
          Posts : 26
          LG
        This is pretty much not going to happen... is it? lol.

        avatar
        • Administrator

            Reputation : 315
            Registered on : 2012-02-22
            Posts : 2362
            School of codes courses: coming soon
          Hello,

          sorry but I was on holiday :bene:

          actually can you explain your problem in a few words?



          Niko wants you in the team Guest

          Community manager and Administrator at Forumattivo.com

          avatar
          • ****


              Reputation : 1
              Registered on : 2014-12-11
              Posts : 59
              Love Fmcodes
            Bump for @Syndrome


            YOUR BANNER HERE
            728x90
            DMCA.com Protection Status
            © PunBB | Contact | Report an abuse