Link button with variable (1 Viewer)

Freshman

Registered User.
Local time
Today, 21:58
Joined
May 21, 2010
Messages
437
Hi all,

I need some help with the syntax of the following please:
I want a 'Submit' button to jump to a URL which is madeup with the info of text input field.

I have this so far:

Code:
<FORM>
  Staff Number: <input type="text" name="staffnum"><br>
</FORM> 

<FORM METHOD="LINK" ACTION="www.mysite.com"/staffnum".pdf">
<INPUT TYPE="submit" VALUE="Submit">
</FORM>

I'm very new to HTML so the code might need cleaning up to be combined

I need the submit button to link to a stored document eg:
www.mysite.com/123.pdf

If '123' was entered in the input field

Can someone assist please?
Thanks
 

Freshman

Registered User.
Local time
Today, 21:58
Joined
May 21, 2010
Messages
437
Got it after lots of tries and searches :)

<script type='text/javascript'>
function doit()
{var x = document.getElementById('symtb').value
window.open('http://www.mysite.com/'+x+'.pdf')}
</script>
<input type='text' id='symtb' value='' size='10'>
<br>
<button onclick='doit()'>Submit</button>
 

Users who are viewing this thread

Top Bottom