Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - populating an input textbox
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

populating an input textbox

 Post Reply Post Reply
Author
simflex View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2002
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote simflex Quote  Post ReplyReply Direct Link To This Post Topic: populating an input textbox
    Posted: 02 November 2004 at 11:42am

Hello all,

I have a dynamic dropdown list box which gets populated based on alue selected from another dropdown listbox.

  

  <td><SELECT Name="to_<%=row%>" size="1" onChange="document.MainForm.testtext.value = this.value;">
  <%
  'loop through recordset/array of all possible blocks
  For i = 0 To UBound(rows,2)
  if rows(COL_Block,i) = Block_ID  then
  response.write("<option selected value='" & rows(COL_To,i) & "'>" & rows(COL_To,i) & "</option>")
  else
    response.write("<option value='" & rows(COL_To,i) & "'>" & rows(COL_To,i) & "</option>")
  end if
  next
  %>
   </SELECT></td>
   <td><input type="text" name="testtext" size="30"></td>


Above code works fine so far.

I also have an input textbox that  I would like to have populated based on value selected from code above.

That is not working so far.

What we would like to do is have the ability to enter a value into the textbox if no value is found from the dropdown.

For instance, if we are given a list of values that are supposed to be on the dropdown value but one or more of those values are not found on the dropdown above, we will like to enter the value in the input textbox manually and then submit that value to the database

Is this possible?

I know that you *cannot* have an input text and a dropdown value with same form variable.

Thanks in advance

 

 



Edited by simflex
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2004 at 1:08pm

Why not just use another name for the input text box?

Also, If when the user selects from the first drop-down, you go to the server to populate the second drop-down, you could just put a category of "OTHER" in the first drop-down. Then on the server, if there's a valuse of "OTHER", write the textbox, otherwise write the second drop down.


Lead me not into temptation... I know the short cut, follow me.
Back to Top
simflex View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2002
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote simflex Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2004 at 2:08pm

hmm, nice idea.

Thanks, that will work.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.