Clarity Service Management

Expand all | Collapse all

How to insert null value in a dropdown?

Jump to Best Answer
  • 1.  How to insert null value in a dropdown?

    Posted 05-14-2015 07:59 AM

    Hi Team,

     

    The values in my symptom_code are binded on the values in resolution_method field in detail_in.htmpl. For that, whenever resolution method changes, symptom code change accordingly. Now I want whenver a user select <empty> for resolution method (which inserts a null value in database), value in my symptom code also show an empty field that inserts a null value in the database. For that I am using the following code:

    document.main_form.elements["SET.symptom_code"].options[0] = new Option("<empty>", null);

     

    But when I run this case, value 0 is updating for symptom_code in call_req table. Which is showing a ? when that updated incident is opened for editing.

     

    Kindly provide the syntax that will insert a null value for symptom_code dropdown.

     

    Thanks & Regards

    Balram Singh Deswal



  • 2.  Re: How to insert null value in a dropdown?

    Posted 05-14-2015 08:26 AM

    Hi,

    could you provide full code of your dropdown?

     

    Regards,

    cdtj



  • 3.  Re: How to insert null value in a dropdown?

    Posted 05-14-2015 08:55 AM

    Hi cdtj,

     

    I have got the solution by hit and trail. To store NULL value, the code to be used should be:

    document.main_form.elements["SET.symptom_code"].options[0] = new Option("<empty>", "");


    Thanks & Regards

    Balram Singh Deswal



  • 4.  Re: How to insert null value in a dropdown?
    Best Answer

    Posted 05-14-2015 08:53 AM

    I think you should use:

    document.main_form.elements["SET.symptom_code"].options[0] = new Option("<empty>", "");

     



  • 5.  Re: How to insert null value in a dropdown?

    Posted 05-15-2015 04:45 AM

    Thanks Gutis.



  • 6.  Re: How to insert null value in a dropdown?

    Posted 07-20-2015 05:42 PM

    Thanks for sharing this Gutis.