943,950 Members | Top Members by Rank

Ad:
Feb 11th, 2009
0

converting drop down menu into a search field

Expand Post »
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

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1.  
  2.  
  3. <select name="catalogPage" >
  4. <%for i = 1 to 396%>
  5. <option value="<%=i%>.pdf"><%=i%></option>
  6. <%next%>
  7. </select>

And that works fine, but Ive tried countless different things and nothing seems to give me the desired result. any thoughts?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Ortal is offline Offline
15 posts
since Apr 2007
Feb 12th, 2009
0

Re: converting drop down menu into a search field

Incorporate this event handler with your select element...
html Syntax (Toggle Plain Text)
  1. 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)!')};"
Last edited by essential; Feb 12th, 2009 at 9:42 am.
Featured Poster
Reputation Points: 114
Solved Threads: 138
Posting Shark
essential is offline Offline
973 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Javascript not working right on FIREFOX!
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Can't paste in a <span> in Firefox





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC