javascript - RequiredFieldValidator with InitialValue that has newline characters not working -


i'm using asp.net requiredfieldvalidator control, , i'm setting initialvalue property string contains 2 newlines ("\n\n").

when perform validation , have not changed control's value initial value, validator not fire, when should.

the reason i've found when view page source, auto-generated javascript sets validator's initial value escaping initial value "\\n\\n", means initial value , control's value different , passes validation when shouldn't.

any ideas on how around this?

i ended figuring out myself, i'm not happy way validator control replaces \n \\n.

when building string had embedded \n in it, instead, used vblf, validator replaces \n. had make sure when set value of control being validated, replaced occurrence of vblf \n, 2 strings matched validation.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -