Goto to page xx Form

Discussion in 'HTML & Website Design' started by Phunk, Mar 28, 2006.

  1. #1
    I'm not sure what language this may be in, html or javascript i think. Any i need an input form that you type the file name in and in goes the the file
    Like sometimes on website you see: skip to page...
    like that
     
    Phunk, Mar 28, 2006 IP
  2. MakZF

    MakZF Well-Known Member

    Messages:
    390
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    140
    #2
    I found this code from The Javascript source, it's long but is easy to understand:
    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    <!-- Original:  Vladimir Geshanov -->
    
    <!-- Web Site:  http://hotarea.com/ -->
    
    <script language="JavaScript"> 
    
    function openDir( form ) { 
    
    	var newIndex = form.fieldname.selectedIndex; 
    
    	if ( newIndex == 0 ) { 
    
    		alert( "Please select a location!" ); 
    
    	} else { 
    
    		cururl = form.fieldname.options[ newIndex ].value; 
    
    		window.location.assign( cururl ); 
    
    	} 
    
    } 
    
    </script> 
    
     
    
    <table width=100% cellpadding=4 cellspacing=0 border=0> 
    
    <form name=form> 
    
    	<tr> 
    
    		<td nowrap> 
    
    			<select name="fieldname" size="1" 
    
    				onChange="openDir( this.form )"> 
    
    				<option>Jump To </option> 
    
    				<option value=http://javascript.internet.com>JSS</option> 
    
    				<option value=http://internet.com>internet.com</option> 
    
    			</select> 
    
    		</td> 
    
    	</tr> 
    
    </form> 
    
    </table> 
    
    
    
    <p><center>
    
    <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
    
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    
    </center><p>
    Code (markup):
    Basically you would put a code in the "<form name=form>" form like <option value=http://yoursite.com>yoursite.com</option> to open any page you want.
     
    MakZF, Mar 28, 2006 IP
  3. Phunk

    Phunk Peon

    Messages:
    95
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    how do you change that you the user can insert the file name want to go to
    Eg the put in "Image.png"
    and it goes to
    www.example.com/uploads/Image.png
     
    Phunk, Mar 28, 2006 IP