...

View Full Version : doubt in javascript



sibuthomas
06-06-2004, 04:51 PM
my asp page contains dynamic controls,in each page controls come dynamically. what i want to do is to access asp variable in javascript validation functions, is it possible or please suggest me a way to validate these form controls which come dynamically according to some question type.

glenngv
06-07-2004, 05:45 AM
something like this?
<%
dim aspStr, aspNum, aspBool
aspStr = "blah"
aspNum = 1
aspBool = True
%>
<script type="text/javascript">
var jsStr = "<%=aspStr%>";
var jsNum = <%=aspNum%>;
var jsBool = <%=LCase(CStr(aspBool))%>;
alert(jsStr);
alert(jsNum);
alert(jsBool);
</script>
Of course, you can't just directly insert asp objects in js, such as arrays, ADO objects, FSO objects and the like.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum