954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

converting drop down menu into a search field

I have this code, I know it has ASP in it but the ASP isnt giving me the hard time, the javascript is (I think...). Right now users can use this drop down menu to get to a certain page, but instead i need to have them type in a number and then have it go to that page in a new window (as they are PDF files) and if not, display an error. Right now I have

<select name="catalogPage" >
<%for i = 1 to 396%>
<option value="<%=i%>.pdf"><%=i%></option>
<%next%>
</select>


And that works fine, but Ive tried countless different things and nothing seems to give me the desired result. any thoughts?

Ortal
Newbie Poster
15 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

Incorporate this event handler with your select element...

onfocus="javascript:try{loc=parseInt(prompt('Please enter a number not more than (your initial value).')); this.selectedIndex=(loc-1); window.open(this.options[this.selectedIndex].value,target='_blank','');}catch(e){alert('Some error(s)!')};"
essential
Posting Shark
974 posts since Aug 2008
Reputation Points: 114
Solved Threads: 138
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You