trouble with manipulating select box.

Results 1 to 7 of 7

Thread: trouble with manipulating select box.

  1. #1
    Join Date
    Dec 1969
    Posts
    27

    Default trouble with manipulating select box.

    I am populating a select box with the data from the database using ado.(recordset). aftert he page is loaded, a user can elect to delete a record from the list box. in that case, i don&#039;t want to go to the database and do it(i know how to do that) but just delete in the client and then onsubmit of that page, update the database. <BR>how can i do this? or update the recordset and then just pass the updated recordset to my stored proc.<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969
    Posts
    5,104

    Default Use JavaScript...

    On your form, create a hidden field.<BR><BR>Use JavaScript to remove the item from the list box and populate the hidden field.<BR><BR>Then, on the server all you need to do is read this hidden field and DELETE from the database.<BR><BR>-Doug

  3. #3
    Join Date
    Dec 1969
    Location
    Los Angeles, CA
    Posts
    21,192

    Default Why not

    FormName.DDName.options[test.DDName.selectedIndex] = null will remove it from the dd<BR><BR>then you can maybe save this id somewhere and when you submit the page, update the db....<BR><BR><BR>

  4. #4
    Join Date
    Dec 1969
    Posts
    27

    Default how do i add it?

    delete works fine...thanks. i have another select box now(just got added in the last 30 min.) from where in a user can add from the other. i have the id as the option value which i can copy but how do i add the text?


  5. #5
    Join Date
    Dec 1969
    Location
    Los Angeles, CA
    Posts
    21,192

    Default See if this helps

    http://www.faqts.com/knowledge_base/view.phtml/aid/1181<BR><BR><BR>Oh and just to let you know i went to google and typed "add options" and presto.....jsut so you MAY want to do the same the next time.<BR><BR>

  6. #6
    Join Date
    Dec 1969
    Posts
    27

    Default it works...one more question

    Thanks<BR><BR>When i try to run this code...it gives me an error. basically, the variables set on ASP pages can&#039;t be read in the script.<BR>how do i read the user_id in my vbscript.<BR><BR>user_id = request("User_ID")<BR><BR>&#060;html&#062;<BR>&#06 0;form.....<BR><BR>&#060;script ="vbscript"&#062;<BR>sub edit_onclick()<BR>...trying the database access<BR><BR>Set rs = createobject("adodb.recordset")<BR>set obj = createobject("xxx.yyy") &#039; my COM component<BR>set rs = obj.GetUserName(User_Id)<BR><BR>end sub<BR><BR>&#060;script&#062;<BR>load the page<BR><BR><BR><BR>&#060;INPUT type="button" value="Edit" id="edit" name="edit"&#062;<BR><BR><BR>&#060;/form&#062;<BR>&#060;/html&#062;

  7. #7
    Join Date
    Dec 1969
    Location
    Los Angeles, CA
    Posts
    21,192

    Default OMG

    you cant do all that on the client side...it HAS to be on the server side ONLY<BR><BR><BR>There is an FAQ on this....you MAY want to read it.<BR><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
  •