lundi 22 mai 2017

If..else conditions error within switch case and can't retrieve the previous selected value

            switch(assettypeid)

               {
                   case '9':
                   alert (namevalue);
                        if (namevalue =="Rack" || namevalue== "VLAN" || namevalue=="Cluster Segment"){
                            $('#remarkhiddenRow').show();
                            $('#filehiddenRow').show();

                            }

                        else if (namevalue=="Vendor"){
                            $('#receiveddatehiddenRow').show();
                            $('#remarkhiddenRow').show();
                            $('#filehiddenRow').show();
                            $('#contacthiddenRow').show();
                            $('#emailhiddenRow').show();
                            $('#supporthiddenRow').show();

                            }

                        else {                          
                            $('#remarkhiddenRow').show();
                            $('#filehiddenRow').show();
                            $('#contacthiddenRow').show();
                            $('#emailhiddenRow').show();

                            }

                            break;

                    default:
                            $('#receiveddatehiddenRow').hide();
                            $("#remarkhiddenRow").hide();
                            $('#filehiddenRow').hide();
                            $('#contacthiddenRow').hide();
                            $('#emailhiddenRow').hide();
                            $('#supporthiddenRow').hide();

               }

I have dropdown list and when select the dropdwon list value (9) if the name is equal with "Rack" I showed up two textboxes, but when I selected "Vendor" it showed six textboxes. However, when I selected back to "Rack" there were also showing six textboxes instead of showing two textboxes. How should I need to do for that case ? Anyone suggest me please !! Thank you.

Aucun commentaire:

Enregistrer un commentaire