converting drop down menu into a search field

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Apr 2007
Posts: 15
Reputation: Ortal is an unknown quantity at this point 
Solved Threads: 0
Ortal Ortal is offline Offline
Newbie Poster

converting drop down menu into a search field

 
0
  #1
Feb 11th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 954
Reputation: essential will become famous soon enough essential will become famous soon enough 
Solved Threads: 131
Featured Poster
essential's Avatar
essential essential is offline Offline
Posting Shark

Re: converting drop down menu into a search field

 
0
  #2
Feb 12th, 2009
Incorporate this event handler with your select element...
  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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC