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?

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)!')};"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.