Find Type of Form Data -
so i'm not sure how word this. trying validate form data json schema. use dojo create form , fetch it's contents when user clicks submits. data in form returned strings. when schema finds field should number throws error because technically string if input '123'. there way form data while preserving it's primitive type?
array.foreach(formdata, function(item) { postdata[string(item.title)] = domattr.get(item, "value"); });
any ideas?
use parseint() or parsefloat() when validating string. check out here.
Comments
Post a Comment