How to receive a string array variable from String array variable of Form in javascript
i am having an attribute of type String array. i have to get t开发者_如何学运维he values of that variable in javascript defined on same page to check its validation.
To have values of a variable in Javascript defined in the same page, the solution is to define them in the same page, otherwise they would not work.
For example
Page 1
...
var values = { ...whatever... }
...
Page 2
...
alert(values);
...
Will not work, But, assuming that you want to do the validation process in Page 2.
Page 1
...
...
Page 2
...
var values = { ...whatever... }
alert(values);
...
...will work. In case you want the values in both pages, the following example applies then.
Page 1
...
var values = { ...whatever... }
alert(values);
...
Page 2
...
var values = { ...whatever... }
alert(values);
...
Greetings.
精彩评论