开发者

How to receive a string array variable from String array variable of Form in javascript

开发者 https://www.devze.com 2023-01-22 04:22 出处:网络
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 Jav

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消