No. The object model on client side and server side are different. For example a field on the client side is accessed as document.FormName.TextFiel
Main Topics
Browse All TopicsHi,
I hope this is an easy one. I'm doing client side validation of form submissions. I've got a JavaScript routine which will process the form. Since I obviously need to do this server-side as well, I'm wondering if it is possible to include the javascript functions on the post page, and have them process the form server side. The post page is in vbscript.
To rephrase, this is essentially a code reuse question. How can I take a client side validation function and run it server side on a page that is written in a different language?
Thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
No. The object model on client side and server side are different. For example a field on the client side is accessed as document.FormName.TextFiel
Hi Si,
Thanks for your comment. When I try to include two different languages on a single page I am confronted with the error "Page Command Repeated".
If I remove the @ then I get either a javascript error or a vbscript error once the server tries to process the other language. How do I have BOTH Javascript and vbscript on the same page?
~Corey
Hi Amit,
I know that the object models are different, what I am doing is passing the validation functions values and processing their return values in the appropriate places. For example, client side I am passing in document.MyForm.MyField.va
~Corey
@amit_g thats why i said the original code may need tweaks.
Anyway yes you can mix the language in a page but be careful about the order in which it is defined.
Here -> http://aspfaq.com/show.asp
btw there is a technical explanation of why the order of execution is not as expected
http://blogs.msdn.com/eric
It is not possible to mix langauges in ASP.NET because of its compiled nature.
There is, I do remember having issues with doing so down to it being a little confusing when coding but it was a while back, I'll see if i find any info on it.
The reason I had to do this was I had written some stuff and a collegue had also written a library which i wanted to use but did not have time to re-write it - so instead used this technique to acheive the result. It is not a method i would recommend normally though as maintenance obviously becomes a pain when the code is harder to read.
basically you can still use response.write("<script language=javascript>....</
I rememeber having a problem with this but cannot remember what it was *(was something silly but not so obvious), anyway i got it working in the end .. best bet i think is to give it a try with some dummy code 1st.
Business Accounts
Answer for Membership
by: Si_HibbardPosted on 2006-03-07 at 10:43:44ID: 16126039
ASP can be written in Javascript or VBscript.
<%@ Language=VBScript %>
<%@ Language=Javascript%>
Obviously the code may need tweaks depending on its original and now inteneded purpose