Click here to Skip to main content
15,887,936 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: in MVC Edit page, how to check for null values? Pin
Richard Deeming30-Jun-15 1:22
mveRichard Deeming30-Jun-15 1:22 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Member 1173386830-Jun-15 17:01
Member 1173386830-Jun-15 17:01 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Afzaal Ahmad Zeeshan30-Jun-15 22:10
professionalAfzaal Ahmad Zeeshan30-Jun-15 22:10 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Member 117338681-Jul-15 13:46
Member 117338681-Jul-15 13:46 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Afzaal Ahmad Zeeshan1-Jul-15 14:50
professionalAfzaal Ahmad Zeeshan1-Jul-15 14:50 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Richard Deeming1-Jul-15 1:17
mveRichard Deeming1-Jul-15 1:17 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Member 117338681-Jul-15 13:56
Member 117338681-Jul-15 13:56 
AnswerRe: in MVC Edit page, how to check for null values? Pin
Afzaal Ahmad Zeeshan30-Jun-15 22:07
professionalAfzaal Ahmad Zeeshan30-Jun-15 22:07 
Is that how you do it in any other language? Clearly you have less idea of how relational operators work.

JavaScript
$('el').val(null);


Code would set the value of that (input only) element to null. It doesn't perform any comparison at all. Which is done by using equality check. You need to use,

JavaScript
if($('#TTest1').val() == '')) { // No type checked
   $('#TTest1').val('No');
}


This would now work.

Another way has been shared by Richard, that is an equality check that also check whether their type is same or not, for example '1' == 1 is true (where as in C# it would be false, because character 1 is not equal to integer 1). For such scenarios you use === which checks the type also. In such case, '1' === 1 would return false. Which means they might have same string representation but not same type. Use that code in order to determine their type and value.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~

GeneralRe: in MVC Edit page, how to check for null values? Pin
Member 117338681-Jul-15 13:40
Member 117338681-Jul-15 13:40 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Afzaal Ahmad Zeeshan1-Jul-15 14:49
professionalAfzaal Ahmad Zeeshan1-Jul-15 14:49 
GeneralRe: in MVC Edit page, how to check for null values? Pin
Member 117338681-Jul-15 15:01
Member 117338681-Jul-15 15:01 
Questionexternal javascript not working Pin
nordyck29-Jun-15 7:31
nordyck29-Jun-15 7:31 
AnswerRe: external javascript not working Pin
Kornfeld Eliyahu Peter29-Jun-15 8:13
professionalKornfeld Eliyahu Peter29-Jun-15 8:13 
GeneralRe: external javascript not working Pin
Member 1173386829-Jun-15 12:47
Member 1173386829-Jun-15 12:47 
AnswerRe: external javascript not working Pin
Leng Vang2-Jul-15 9:38
Leng Vang2-Jul-15 9:38 
Questionjquery slideshows Pin
vikkismarty29-Jun-15 5:21
vikkismarty29-Jun-15 5:21 
QuestionStore one value from rows of data in a table Pin
Rajesh_198025-Jun-15 3:29
Rajesh_198025-Jun-15 3:29 
AnswerRe: Store one value from rows of data in a table Pin
jkirkerx26-Jun-15 8:46
professionaljkirkerx26-Jun-15 8:46 
GeneralRe: Store one value from rows of data in a table Pin
Rajesh_198029-Jun-15 6:31
Rajesh_198029-Jun-15 6:31 
GeneralRe: Store one value from rows of data in a table Pin
jkirkerx29-Jun-15 6:59
professionaljkirkerx29-Jun-15 6:59 
QuestionComparing two dates Pin
ap@238722-Jun-15 20:44
ap@238722-Jun-15 20:44 
AnswerRe: Comparing two dates Pin
User 418025410-Jul-15 12:01
User 418025410-Jul-15 12:01 
QuestionHow can I convert image to video in Javascript? Pin
Member 1161266222-Jun-15 20:33
Member 1161266222-Jun-15 20:33 
AnswerRe: How can I convert image to video in Javascript? Pin
jkirkerx26-Jun-15 8:55
professionaljkirkerx26-Jun-15 8:55 
QuestionShow more messages in a scroller Pin
Rajesh_198022-Jun-15 10:32
Rajesh_198022-Jun-15 10:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.