Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

ASP combo box problem

  • 07-06-2006 11:14am
    #1
    Registered Users, Registered Users 2 Posts: 4,113 ✭✭✭


    I've got a combo box on an ASP page whose contents go into a table. A tick box has to be checked which disables it.
    The contents of the combo box (along with other details on the page from other comboxes, textareas etc.) are then entered into a table but I can't get the value in the combo box to go in to the table when it is disabled.
    I posted a similar problem here before but that was easy as it was a textarea's contents that was being transferred.
    In that case I just created a hidden textarea and transferred it to that.
    It's less easy with a combo box.


Comments

  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    Best off posting a bit of code so we can see where your problem lies..there's no one definitive solution for these problems.


  • Registered Users, Registered Users 2 Posts: 4,113 ✭✭✭lukin


    This is the combo box I want to take the values from
    <select name="cmbBugType" class="smalltextbox" onchange="checkRequest()">

    <% for i = 0 to ubound(vType)
    Response.Write("<option value='" & vType(i) & "'>" & vType(i) & "</option>")

    next
    %>

    </select>

    This is the textarea I want to transfer the contents of the combo box to
    <textarea type="hidden" name="dfBugType2" class="fulltextbox" value=""></textarea>

    This is the code I am using to transfer the contents of the combo box to the textarea:
    if (objForm.cmbBugType.disabled==true){
    document.getElementById("dfBugType2").value = document.getElementById("cmbBugType").value;
    }


  • Registered Users, Registered Users 2 Posts: 683 ✭✭✭Gosh


    AFAIK the onChange event on a select box only fires when the value is changed not when it's disabled.

    Your event should be on the tickbox - use the onClick rather than onChange as IE only fires the event when the tickbox loses focus (onBlur). The onClick event for the tickbox should check the .checked property for true
    if(document.getElementById('checkboxname').checked) {
       it's clicked on process
    }else{
       it's click off process
    }
    


  • Registered Users, Registered Users 2 Posts: 4,113 ✭✭✭lukin


    I think I've it sorted now: it turns out you can transfer the value in a combo box to an invisible text area.
    I didn't think it was doing it because I had the code to do it under the "onchange" event of the combo box. I clicked the button on the page that enters the data into the table without touching the combo box.
    Hence it doesn't transfer the data at all.
    Im just moved the code that does it to under the button that enters the data to the table.


Advertisement