TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 317
  • Total: 317

Article - New topic form (pre-formated topic)

Started by londonhogfan, April 20, 2006, 05:14:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

Did you modify which board its posting to? Look at the code and you'll see it posts to a certain board. Make sure you have the same board ID number that you need to use.

NYPDSwat

Thanks IchBin board it was posting to was correct but as I looked colser I found something else that was wrong :)

Now it works Hooah!!!

Ripchi

I'm using the code from below and wondering if anyone can tell me how to add a drop down selection menu?  For example, I want to include a list of the US states, and they can click the box to select the state they reside in.  I'm new to all this, so any help is appreciated.

Quote from: Noam on March 21, 2007, 01:39:51 AM
Late to the party, I know, but in case people were looking for some other examples, here's one for our WoW guild. We needed some longer text entry areas, and believe me, getting textareas on the form was a pain:

Made a php article titled "Apply to FOO" and linked it off the front page, contents follows:


/*
Noam's Notes:
0. Backslash every apostrophe in the big echo statement below.
1. Never, ever put in a closing textarea tag literally. It will screw up the article editor somethin' fierce. Use '</text'.'area>' instead.
*/
echo '
<form name="application">
    <p>1. Say hello and tell us a little bit about yourself: this is the only in-character question in this application. If you\'re new to RP don\'t stress over this. Just a quick hello and who you are.<br />
    Character Name: <input type="text" name="characterName" size="40"><br>
    Character Introduction:<br>
    <textarea rows="10" cols="80" name="characterIntro"></text'.'area></p>
    <p>2. Is this your main character and what level are you?<br />
    <input type="radio" name="isMain" value="Yes" />Yes, this is my main character.<br />
    <input type="radio" checked="checked" name="isMain" value="No" />No, this is not my main character.<br />
    <input maxlength="2" size="3" name="characterLevel" type="text" />Level</p>
    <p>3. Please list the guilds on BAR you have been a member of. If you\'re a transfer, please list the server and guilds you have transferred from and the reason you transferred.<br />
    <textarea rows="10" cols="80" name="priorGuilds"></text'.'area></p>
    <p>4. Do you have any Alternative Characters you wish to bring into the guild? If yes, what are their names and levels?<br />
    <textarea rows="10" cols="80" name="altCharacters"></text'.'area></p>
    <p>5. Have you ever had a character enrolled in FOO or BAZ in the past? If yes, what were your reasons for leaving, and what was the name of the character you were enrolled under?<br />
    <textarea rows="10" cols="80" name="priorFooCharacters"></text'.'area></p>
    <p>6. What is it that you are looking for in and want from a guild?<br />
    <textarea rows="10" cols="80" name="whatLookingFor"></text'.'area></p>
    <p>7. What is it you bring to the guild? (trade skills, etc. Anything else you think is pertinent)<br />
    <textarea rows="10" cols="80" name="whatBringing"></text'.'area></p>
    <p>8. What is your RP (Role Playing) experience?<br />
    <textarea rows="10" cols="80" name="rpExperience"></text'.'area></p>
    <p>9. How long have you played WoW?<br />
    <textarea rows="10" cols="80" name="howLongPlayed"></text'.'area></p>
    <p>10. Have you created a history or back story for you character? (not a requirement; see the Conduct)<br />
    <input type="radio" name="hasBackstory" value="Yes" />Yes, I have a backstory.<br />
    <input type="radio" checked="checked" name="hasBackstory" value="No" />No, I have no backstory.</p>
    <p>Do you understand this must comply with WoW\'s Azerothian Lore as well as FOO\'s Lore and Conduct?<br />
    <input type="radio" name="understandLore" value="Yes" />Yes, I understand.<br />
    <input type="radio" checked="checked" name="understandLore" value="No" />No, I don\'t understand.</p>
    <p>How do you feel about advice or comments on your character\'s history/backstory?<br />
    <textarea rows="10" cols="80" name="feelAboutComments"></text'.'area></p>
    <p>11. Have you read The Conduct of FOO and agree to abide by these guidelines and rules?<br />
    <input type="radio" name="hasReadConduct" value="Yes" />Yes, I\'ve read it and I agree.<br />
    <input type="radio" checked="checked" name="hasReadConduct" value="No" />No. I\'ve either not read it, or don\'t agree.</p>
    <p>12. Do you have any comments or questions regarding joining or being a member of FOO?<br />
    <textarea rows="10" cols="80" name="commentsAndQuestions"></text'.'area></p>
    <p>13. Where did you hear of FOO?<br />
    <textarea rows="10" cols="80" name="whereYouHeard"></text'.'area></p>
</form>
<p>Thank you for your time in filling this out and reading the Conduct. We look forward to meeting you in game.</p>

<form action="http://SERVERNAME/index.php?action=post;board=TARGETBOARD" method="post" name="postmodify" id="postmodify" style="margin: 0;">
<input type="hidden" name="subject">
<input type="hidden" name="icon" id="icon" value="xx">
<input type="hidden" name="message">
<input type="hidden" name="sc" value="'.$context['session_id'].'">

<script>
function CompileForm()
{

  characterName=document.application.characterName.value;
  characterIntro=document.application.characterIntro.value;

  for (i=0;i<document.application.isMain.length;i++){
    if (document.application.isMain[i].checked==true){
      theone=i; break;
    }
  }
  if (theone==0) { isMain="Yes"; } else { isMain="No"; }

  characterLevel=document.application.characterLevel.value;
  priorGuilds=document.application.priorGuilds.value;
  altCharacters=document.application.altCharacters.value;
  priorFooCharacters=document.application.priorFooCharacters.value;
  whatLookingFor=document.application.whatLookingFor.value;
  whatBringing=document.application.whatBringing.value;
  rpExperience=document.application.rpExperience.value;
  howLongPlayed=document.application.howLongPlayed.value;

  for (i=0;i<document.application.hasBackstory.length;i++){
    if (document.application.hasBackstory[i].checked==true){
      theone=i; break;
    }
  }
  if (theone==0) { hasBackstory="Yes"; } else { hasBackstory="No"; }

  for (i=0;i<document.application.understandLore.length;i++){
    if (document.application.understandLore[i].checked==true){
      theone=i; break;
    }
  }
  if (theone==0) { understandLore="Yes"; } else { understandLore="No"; }

  feelAboutComments=document.application.feelAboutComments.value;

  for (i=0;i<document.application.hasReadConduct.length;i++){
    if (document.application.hasReadConduct[i].checked==true){
      theone=i; break;
    }
  }
  if (theone==0) { hasReadConduct="Yes"; } else { hasReadConduct="No"; }

  commentsAndQuestions=document.application.commentsAndQuestions.value;
  whereYouHeard=document.application.whereYouHeard.value;

  strCompiled=
    "[b]Character name:[/b] " + characterName + "\n\n" +
    "[b]Character introduction:[/b]\n" + characterIntro + "\n\n" +
    "[b]Main character?[/b] " + isMain + "\n" +
    "Level " + characterLevel + "\n\n" +
    "[b]Prior guilds:[/b]\n" + priorGuilds + "\n\n" +
    "[b]Alt characters:[/b]\n" + altCharacters + "\n\n" +
    "[b]Prior FOO characters:[/b]\n" + priorFooCharacters + "\n\n" +
    "[b]What you\'re looking for:[/b]\n" + whatLookingFor + "\n\n" +
    "[b]What you\'re bringing:[/b]\n"  + whatBringing + "\n\n" +
    "[b]RP experience:[/b]\n" + rpExperience + "\n\n" +
    "[b]How long you\'ve played WoW:[/b]\n" + howLongPlayed + "\n\n" +
    "[b]Has a backstory:[/b] " + hasBackstory + "\n" +
    "[b]Understands compliance with Lore:[/b] " + understandLore + "\n\n" +
    "[b]Feels about comments on backstory:[/b] " + feelAboutComments + "\n\n" +
    "[b]Has read conduct and agrees:[/b] " + hasReadConduct + "\n" +
    "[b]Comments/questions:[/b]\n" + commentsAndQuestions + "\n\n" +
    "[b]Where you heard about FOO:[/b]\n" + whereYouHeard;
 
  document.postmodify.subject.value="New Member Application: "+characterName;
  document.postmodify.message.value=strCompiled;
 
  document.postmodify.submit();
}
</script>

Click the button below, and you\'ll see a pre-formatted post on the member applications board, where you will still need to hit the Post button to actually apply.<br>
<input type="button" name="btnSubmit" value="Submit Application" onclick="CompileForm()">
</form>
';



Rebecca

hi everyone,

i just found this site www.emailmeform.com you can create your own forms and have the details emailed to you, I am running this on my site for competitions!! :-)

ianus

Greetings!


@Rebecca
Thanks a lot for this link. It seems to solve a lot of problems with individual preformatted topics. (At least for me, because I have no coding knowledge and always problems to keep the dependencies between the form and the compilation intact.)

Before I register at www.emailmeform.com, I would like to know how the code looks, which is generated and send and what I have to add, to make it work inside the TP.

In my case, I don’t need a contact form but an easy way (for users) to submit News and Charakter-Guides. (Examples, see below.)

Maybe you can give an example of the code they send and an example of the final implementation?


Then I have read this:
Quote
Your web hosting server does not need to be able to run scripts, our powerful server process the form submission, sends you an email with the information and then redirect the visitor to your thank you web page, without the visitor knowing he left your web site.

I think I don’t understand.
I show the input-page at MySite, a user fill out the form
-> it is send to another server (our powerful server process the form submission)
-> I receive the result vie mail (sends you an email with the information)
-> the user is redirected to a (my) page (then redirect the visitor to your thank you web page)

Sound strange.

Maybe you can describe a bit, how you use this service an the code?


(Exmples only to make clear what I want to include. Not an request or something)
Example: News
[Topic Title]:
[Headline]:
[Some Text]:
[Maybe a quote]: [ quote ][ /quote ]
[Source]:

Example: CharGuide
[Topic Title]:
[Introduction]
[desired attribute a]:
[desired attribute b]:
…
[Ability a]:
[Ability b]:
…
[How to play]:
[Recommended Companions]:


Rebecca

Hi ianus,

Ok you dont have to worry about doing any scripts as such, its generates a code that you put in a html article, i have used it a few times on my site now and i absolutely love it... you can see a preview of one of my forms here (At the very bottom "click here to enter") http://www.bu-community.com/index.php?page=63

this is the code it generated after i entered what fields/items i wanted...

<a target="_new" href="http://www.emailmeform.com/fid.php?formid=112582">Click Here to Enter</a>

you will need to create another article so that when people submit the form they will be directed to that page, it emails you straight away with all the details. comes highly recommended, i think its awesome and even better its free and does everything the paid ones do... i had a look at quiet a few before i settled for this one and im more than happy!

hope that helps, if you need any help or have any other questions just pm me :)

ianus

Greetings!

Thanks a lot for you kind reply!

Well, I see what this side offers more clearly now and imho it is be a nice function for webmasters.
But the service don’t meet my requirements because there is no own form which I can put into an article and finally send is as an topic to the SMF.

Anyway, this leads me to an interesting idea.

Thanks again for your time.
Regards
ianus

Rebecca

Your welcome if you look back through this topic you will see some codes that will give you the option of creating a topic rather than emailing. Good luck :)

mrsk

I know this is an old thread but I was wondering if someone could help me... I used this code (tried in html and php) and cannot get it to post when I hit submit ...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Join</title>
</head>

<body>
<div align='center'>
<body bgcolor='#666666'> 

<table>
<tr><td><font color="#FF0000">
Please fill out the Application completely.</font><br>
<br>

<form name='frmFill'>
<table>
<tr><td><font color="#FFFFCC">
Real first name: </td><td><input type='text' name='txtRealName' size='50' value=''></td>
</tr>
<tr><td><font color="#FFFFCC">
Age: </td><td><input type='text' name='txtAge' size='50' value=''></td>
</tr>
<tr><td><font color="#FFFFCC">
Location (Time Zone ONLY!!): </td><td><input type='text' name='txtLocation' size='50' value=''></td>
</tr>
<tr><td><font color="#FFFFCC">
PSN Name: </td><td><input type='text' name='txtPSNName' size='50' value=''></td>
</tr>
<tr><td><font color="#FFFFCC">
Playtime: </td><td><input type='text' name='txtPlaytime' size='50' value=''></td>
</tr>
</table>
<br /><font color="#FFFFCC">
Are you currently in a clan or have you previously been in a clan? <input type='radio' name='optCPG' value='Yes' >Yes <input type='radio' name='optCPG' value='No' checked>No<br />
<br />
If yes why did/do you wish to leave that clan?<br />
<textarea class='editor' rows='5' cols='60' style='color: #800000' name='taExpGuildLeave'></textarea><br />
<br />
Referral:<br />
<textarea class='editor' rows='5' cols='60' style='color: #800000' name='taReferral'>
How did you hear about us? Website, a friend refer you? Please be descriptive, don't just give a name, tell us how you know them.
</textarea><br />
<hr />
<br />

Reason for Applying (Why did you choose AsY)?<br />
<textarea class='editor' rows='5' cols='60' style='color: #800000' name='taGoals'></textarea><br /><br />


<hr />
(Optional) Other Comments: <br />
<textarea class='editor' rows='5' cols='60' style='color: #800000' name='taComments'></textarea><br /><br />


</form>


<br />
<form action='http://www.asylumclan.com/forums/index.php?board=11.0' method='post' name='postmodify' target='_parent' id='postmodify' style='margin: 0;'>
<input type='hidden' name='subject'>
<input name='icon' id='icon' value='xx' type='hidden'>
<input type='hidden' name='message'>
<input type='hidden' name='sc' value='', $context['session_id'], '' />

</form>


<script>


function CompileForm()
{

strRFN=document.frmFill.txtRealName.value;
strAge=document.frmFill.txtAge.value;
strLoc=document.frmFill.txtLocation.value;
strPSNN=document.frmFill.txtPSNName.value;
strPlytm=document.frmFill.txtPlaytime.value;
if(document.frmFill.optCPG[0].checked)
{
strOtherGuild=document.frmFill.optCPG[0].value;
}
else
{
strOtherGuild=document.frmFill.optCPG[1].value;
}
strGuildLeave=document.frmFill.taExpGuildLeave.value;
strRef=document.frmFill.taReferral.value;
strWhy=document.frmFill.taWhyJoin.value;
strComments=document.frmFill.taComments.value;


str1='Real first name: ';
str2='\nAge: ';
str3='\nLocation: ';
str5='\nPSN Name: ';
str6='\nClass: ';
str7='\nLevel: ';
str8='\nPlaytime: ';
str12='\nAre you currently in a clan or have you previously been clan?\n';
str13='\nWhy did/do you wish to leave that clan?\n';
str14='\n\nReferral:\n';
str16='\n\nReason for Applying (Why did you choose AsY)?\n';
str17='\n\n(Optional) Other Comments:\n\n';

strPart1=str1+strRFN+str2+strAge+str3+strCS+str5+strPSNN+str6+strClass+str7+strLvl+str8+strPlytm+str12+strOtherGuild;
strPart2=str13+strGuildLeave;
strPart3=str14+strRef+str16+strWhy;
strPart4=str17+strComments;


strCompiled=strPart1+strPart2+strPart3;

document.postmodify.subject.value=strPSNN;
document.postmodify.message.value=strCompiled;

document.postmodify.submit();


}

</script>

</td></tr></table>
</div>
<div align='center'>
<font size="4" color="#FF0000"><span style="background-color: #000000">
<br />By submitting an Application with us, you are confirming you have read, and understand, the [AsY] Code of Honor. If accepted as a Cadet, you agree to abide by it, and any other guidelines we set.<br /><br /> </span></font>
<input type='button' name='btnSubmit' value='Submit' onclick='CompileForm()'>
<br /><font color="#FFFFCC">Once submitted, it will take you to a pre-formatted post on the member applications board, where you will still need to hit the post button. </font><br />
<br />

</div>

</body>
</html>


now I put it in where I want it to post.. and still nothing when I submit.... I named this file join.html and placed it in my Main site section with all my other files, and it is supposed to post in another section of my files under forums .. am I placing it wrong?? ... the app comes up and everything there is right but it just will not submit... I am using SMF forums and I am just learning by trial and error mostly html/php coding, so it just may be that I dont have it where it should be... any ideas please let me know.... thanks

ZarPrime

mrsk,

Welcome to TinyPortal.

Please Read and Reply to the Posting Guidelines and give us as much information as you can about your setup, including a link to your site.  Also, there is no php in that code so it won't work in a php block.  One of our coders will have to take a look at your code so please be patient until they can get on here and look at it.

ZarPrime

This website is proudly hosted on Crocweb Cloud Website Hosting.