Loading data in a table through a list box

Results 1 to 2 of 2

Thread: Loading data in a table through a list box

  1. #1
    Join Date
    Dec 1969

    Default Loading data in a table through a list box

    I have been using ASP for a few months and still very new to it. I looked in the FAQS but I couldn&#039;t find any kind of solution. I just got off of Access 2000 and I&#039;m trying to convert one of my databases using ASP.<BR><BR>I have a table (tblJobName) with 2 fields (fldJobID, fldJobName)<BR>I want to create an empty text box or a list box where a user can cut and paste job names into, press a button and have the jobs appended to the tblJobName table. I was thinking I could do it by having the user select the jobs inserted in the box and hit a button but I&#039;m stumped on how to do it without selecting the pasted items.<BR><BR>Also, I have a few combo boxes that would be nice if the user could update "on the fly". If a value entered is not in the combo list, prompt the user if he/she would like it added. Is there a way to do this?<BR><BR>Thanks in Advance!

  2. #2
    Join Date
    Dec 1969

    Default Nothing to do with ASP or DB

    This strictly an in-the-browser JavaScript issue.<BR><BR>What you are looking for is an ActiveX "combo box", but HTML doesn&#039;t have any such animal.<BR><BR>So the best you can do is use a combination of a &#060;SELECT&#062; and an &#060;INPUT TYPE=TEXT&#062; to do this.<BR><BR>Something such as:<BR><BR>&#060;FORM&#062;<BR>&#060;SELECT Name="JobNames"&#062;<BR>...<BR>&#060;/SELECT&#062;<BR><BR>&#060;INPUT Type=Text onChange="addJob(this);"&#062;<BR>...<BR>&#060;/FORM&#062;<BR><BR>&#060;SCRIPT Language="JavaScript"&#062;<BR>function addJob( txtfld )<BR>{<BR> var selfld = txtfld.form.JobNames;<BR> selfld.options[ selfld.options.length ] = new Option(txtfld.value,txtfld.value);<BR> selfld.selectedIndex = selfld.options.length-1; <BR> txtfld.value = "";<BR>}<BR>&#060;/SCRIPT&#062;<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts