Link in W3Schools:JavaScrpit Form Validation
function validate_required(field,alerttxt){with (field){if (value==null||value=="") {alert(alerttxt);return false}else {return true}}}
I am a traditional programmer (C, C++) and am learning some web development technologies like JavaScript, XHTML, CSS etc.As a more traditional programmer I am used to the C/C++/Java syntax of always including a paramater type in the argument list and following strict syntax and declaration fules. In the code referenced above, I notice that in function validate_required() that the parameter types are missing as is the norm in JavaScrpit. I can understand from the context that alerttxt is a JavaScript String object but what type of object is field?!?!This also brings me to my next question. In the same function there is a mention of a keyword(?) with in conjunction with the variable field.I do not understand the function of this keyword and how it relates to the variable field.Also, there is an undeclared identifier value in this function as well.Please help me in understanding some of the code use as well as elaborate on rules of syntax/declaration assumed in the above expample.Thank you.