Jump to content
xisto Community
Sign in to follow this  
veerumits

What Is The Basic Diiference In Java Script And Vbscript java script use javas code and vb script use vbcode

Recommended Posts

what is the basic diiference in java script and vbscript,
java script and vb script are very much popular validation language.

both these are use for validation but finally what is difference in between two can one replace to other it is possible. then how much change are required.give any example for both vb and java script. with code.
i am not using any one. most time use i use PHP validation as i know it very well, but i want to move to this side also, any suggetion, advice, views all are welcomes.

here i am posting sample how to use PHP validation
i am use PHP regular expression syntex.

<?php if(!isset($_POST["OK"])){if(empty($_POST["fname"])){$fnmerror='Invalid First Name';}elseif(empty($_POST["lname"])){$lnmerror='Invalid Last Name';}elseif(empty($_POST["age"])){$ageerror='Invalid Age';}elseif(empty($_POST["city"])){$cityerror='Invalid City';}elseif(empty($_POST["pin"])){$pinerror='Invalid Pin No.';}elseif(empty($_POST["mob"])){$moberror='Invalid Mobile No.';}elseif(empty($_POST["email"])){$emailerror='Invalid Email address';}else{$result =" Thanks submitting your Information";}}?><body bgcolor="#99CC66" text="#663333" link="#FFFF00" alink="#996666" vlink="#FF6666"><center>  <form action="Student.php" method="post">	<H1><font color="#800000">Please Fill The Following information :</font></H1>	<font color="#800000"><br>	</font>	<TABLE BORDER="" BGCOLOR="yellow" width="448" height="293">		<TD height="2" width="86"> 	  <TR> 		<TD width="86" height="35"><font size="+1" color="#800000">First Name</font></TD>		<TD width="41" height="35"><font color="#800000">:</font></TD>		<TD width="299" height="35"> <font color="#800000"> 		  <input type="text" name="fname" value="<?php echo $_POST["fname"]; ?>"/>		  <b>		  <?php echo '<font color="RED">'.$fnmerror.'</font>'; ?>		  </b> </font></TD>	  </TR>	  <TR> 		<TD width="86"><font size="+1" color="#800000">Last Name</font></TD>		<TD width="41"><font color="#800000">:</font></TD>		<TD width="299"> <font color="#800000"> 		  <input type="text" name="lname" value="<?php echo $_POST["lname"]; ?>" />		  <b>		  <?php echo '<font color="RED">'.$lnmerror.'</font>'; ?>		  </b> </font></TD>	  </TR>	  <TR> 		<TD width="86"><font size="+1" color="#800000">Age</font></TD>		<TD width="41"><font color="#800000">:</font></TD>		<TD width="299"> <font color="#800000"> 		  <input type="text" name="age" value="<?php echo $_POST["age"]; ?>" />		  <b>		  <?php echo '<font color="RED">'.$ageerror.'</font>'; ?>		  </b> </font></TD>	  </TR>	  <TR> 		<TD width="86"><font size="+1" color="#800000">City</font></TD>		<TD width="41"><font color="#800000">:</font></TD>		<TD width="299"> <font color="#800000"> 		  <input type="text" name="city" value="<?php echo $_POST["city"]; ?>" />		  <b>		  <?php echo '<font color="RED">'.$cityerror.'</font>'; ?>		  </b> </font></TD>	  </TR>	  <TR> 		<TD width="86"><font size="+1" color="#800000">Pin No.</font></TD>		<TD width="41"><font color="#800000">:</font></TD>		<TD width="299"> <font color="#800000"> 		  <input type="text" name="pin" value="<?php echo $_POST["pin"]; ?>" />		  <b>		  <?php echo '<font color="RED">'.$pinerror.'</font>'; ?>		  </b> </font></TD>	  </TR>	  <TR> 		<TD width="86"><font size="+1" color="#800000">Mobile</font></TD>		<TD width="41"><font color="#800000">:</font></TD>		<TD width="299"> <font color="#800000"> 		  <input type="text" name="mob" value="<?php echo $_POST["mob"]; ?>" />		  <b>		  <?php echo '<font color="RED">'.$moberror.'</font>'; ?>		  </b> </font></TD>	  </TR>	  <TR> 		<TD height="28" width="86"><font size="+1" color="#800000">Email</font></TD>		<TD height="28" width="41"><font color="#800000">:</font></TD>		<TD height="28" width="299"> <font color="#800000"> 		  <input type="text" name="email" value="<?php echo $_POST["email"]; ?>" />		  <b>		  <?php echo '<font color="RED">'.$emailerror.'</font>'; ?>		  </b> </font></TD>	  </TR>	  <TR SIZE="100"> 		<TD colspan="3" height="7"><font color="#800000"> <b>		  <input type="Button" size="40" name="result" value =" <?php echo $result; ?> " />		  </b> </font></TD>	  </TR>	  <TR> 		<TD width="86" height="3"><font color="#800000">.</font></TD>		<TD width="41" height="3"> <font color="#800000"> 		  <input type="Submit" value="OK" />		  </font></TD>		<TD width="299" height="3"><font color="#800000">.</font></TD>	  </TR>	</TABLE>  </form></center>

just like this example if you have code please appreciate me.

Thanks.

Share this post


Link to post
Share on other sites

Vb script is a server side language where javascript is a client side language.In other words vb script works on your web sites server where javascript
works on your browser.


Yes...VB Script can be used in server side to assist server side scripting languages of Microsoft like Active Server Pages(ASP). But VB Script can also be used in client side. Actually VB Script was designed to run as a client side scripting language(that runs in the client's browser). VB Script was an answer of Microsoft to Netscape's Javascript at that time. But later javascript became a standard. Because javascript is widely supported by almost all browsers...where vbscript failed. :)

Share this post


Link to post
Share on other sites

You're completely wrong buddy.Vb script is not client side.Purelyserver side.Therefore there is no point even comparing Visual basic to javascript,though Visualbasic(From which vb script is based.) has been around since about 1962.Javascript came much later(mid 1990's).

Share this post


Link to post
Share on other sites

You're completely wrong buddy.Vb script is not client side.Purely

server side.Therefore there is no point even comparing Visual basic to javascript,

though Visual

basic(From which vb script is based.) has been around since about 1962.Javascript came much later

(mid 1990's).

Nooo.....I'm not comparing VB to javascript. I'm just comparing VB Script to Javascript :)

 

Edit:

 

Well OK. Here is a VBScript that works in client side. VBScript is not purely server side language. May be you've overlooked that VBScript is not client side. I'm not going to prove you're wrong or I'm right. I'm just pointing some things you may had overlooked. :D

 

OK. Copy this program and save as html file like vbstest.html and open it through Internet Explorer(and yes.....IE only....this won't work on many other browsers..the weakness of VBScript :D ).

 

If your Internet Explorer blocks the script and displays popup warning below address bar, click on it and select

Allow Blocked Content

 

<html>	<head>		 <title>proof that VBScript is client side </title>		  <script  language="VBScript">			   Document.Write "Hello networker...this is working!<BR>"			   Document.Write "Today is " & NOW()			   MsgBox "This is also proof that VBScript is client side also"		  </script>	 </head>	 <body> 		  <h1>VBScripts Client Side Script</h1>	 </body></html>

The VBScript in the above html file will dispay an Alert Box dislpaying "This is also proof that VBScript is client side also". And also it'll display a text "Hello networker....this is working" and in the next line it will display Today's Date and current Time. All this runs in the client side browser only(javascript does the same way). Thats why we call it Client side scripting. I'm very glad to answer if you have any other questions or arguments.... :)
Edited by xpress (see edit history)

Share this post


Link to post
Share on other sites

You know,you are right.
I can't believe after all this time I never
used vb script clientside.I guess it's because
I've been concentrating on php too much for years
and messing around at home with vb .net desktop applications.

Thanks

This is something simple I wrote for somebody in php. I used
javascript client side to open up new windows :

http://forums.xisto.com/no_longer_exists/

Edited by networker (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.