Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HEllO Team,

I have the code as follows:
There are three different Controls as follows:
1.One Textbox as follows:
XML
<td>
    <input type="text" id="topCountForQCTextbox" style="width: 90px;" />
                    </td>



2.DropDown As Follows:
XML
<td>
                       <select id="allocateToSelect" class="combo150">
                        </select>
                   </td>


3.Label as follows
XML
<td>
                       <label id="allocateToQCCountLabel">
                           QC Count :
                       </label>
                   </td>


My Functionality as follow :
User will select the value from DropDown and value will get display in Label.But There are Condition which I need To Perform as Follows:

First Condition.
when i am selecting the any selected value from DropDown.On that time ,In textbox ("topCountForQCTextbox") i want to set or display the value as 0(zero).

Second Condition:
Secondily, The previous value that is 0 (zero) get removed , when i am putting the value in textbox,

i have used the jquery For textbox ("topCountForQCTextbox") as follows:
C#
function allocateQCEntity() {
            var allocateQC = cloneObject(blankQCAllocationEntity);
            
            allocateQC.TopCountForQC = $('#topCountForQCTextbox').val();

            if (allocateQC.TopCountForQC == null || allocateQC.TopCountForQC == '') {
                allocateQC.TopCountForQC == '0';
            }
            
            return allocateQC;
        }

Everything is working ,But i want to validate this Conditions.
When page load ,on textbox ("topCountForQCTextbox") no values is present ,it is blank .
when i am selecting any selected value from DropDown.On that time ,In textbox ("topCountForQCTextbox") i want to set or display the value as 0(zero).

Secondily, The previous value that is 0 (zero) get removed , when i am putting the value in textbox,

I have try this but no use
C#
if (allocateQC.TopCountForQC == null || allocateQC.TopCountForQC == '') {
                    $('#topCountForQCTextbox').val(0);
                }

It set the value when textbox is empty,but when i put the any number that is 1 or 2 ,then also it getting the value as 0 ,which i dont want.when i put any value that is 1 ,2 3 ... so on that time textbox value get pickup not 0 (Zero).

How do i validate ???.What changes i need to make in my Code.
Please Guide me.

Kindly Assist.

Thanks
Harshal
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900