HEllO Team,
I have the code as follows:
There are three different Controls as follows:
1.One Textbox as follows:
<td>
<input type="text" id="topCountForQCTextbox" style="width: 90px;" />
</td>
2.DropDown As Follows:
<td>
<select id="allocateToSelect" class="combo150">
</select>
</td>
3.Label as follows
<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:
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
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