Forum coding issue

Associate
Joined
28 Aug 2010
Posts
67
Hey everyone, I am an Administrator of a medium-large Forum Community. Recently it was suggested that I develop and code a Quick Find Thread system, basically, there would be a 6 digit number at the bottom of the page, that a user could save, and use to get to threads rather quickly, so I took it on, I've been working on it for about 3 days, and although it should be simple enough to do, I've ran into a host of problems.

This is the code that I currently have:
Code:
<form action="http://s15.zetaboards.com/Skillers_Union_Clan/topic/" method="post"/>

Jump to Thread: 
  <input type="text"  class="text" value="" size="6" maxlength="6" />
  </br>
<input name="Submit" type="submit"/> 
 
</form>

This produces a text box, and a submit button, that should in theory take the six digit code out of the text box, and add it to the end of the URL, thus directing them to the requested thread. However, it doesn't work. I've scavenged Google, and found nothing but unrelated code, that doesn't do any better.

Any ideas/advise would be appreciated.

Nick
 
First if your trying to add anything to the URL you want the GET method not the POST method.

Next why not use a simple bit of javascript to append the number onto the end of the url?
Code:
location.href += textBox.value;
 
Yeah, I meant to change the 'Post' to 'get'.

I don't generally use Javascript, as I've never had the time to learn it, as such, where in the code does it fir, because:

Code:
Jump to Thread: 
 <form> 
<input type="text"  class="text"  size="6" maxlength="6" />
<script type='text/javascript'>
http://s15.zetaboards.com/Skillers_Union_Clan/topic/ += textBox.value;
</script>
<input name="Submit" type="submit"/> 
 </form>
This doesn't work, either.

Nick
 
Haha, right ok I have a bad habit of assuming that people know what I'm on about :p

You would nee to do something like this:

Code:
<form id="LinkToThreadForm"> 
	<input type="text"  class="text"  id="threadID" size="6" maxlength="6" />
	<script type='text/javascript'>
		function GoToThread()
		{
			window.location = (location.href + document.getElementById("threadID").value);
			document.LinkToThreadForm.submit();
		}
	</script>
	<input type="button" value="Go To Thread" onClick="GoToThread();"/> 
</form>

I haven't tested this but it should be along the lines of you want, you might need to tweak it slightly to suit your needs.
 
Back
Top Bottom