Forums
This topic is locked
convert java script to vbscript
Posted 09 Jan 2006 03:04:33
1
has voted
09 Jan 2006 03:04:33 likez praise posted:
Hello everyone I am having trouble converting this codes.I want to convert this codes to vbscript: to validate if the user enter text on each field.
<script Language="JavaScript">
function FrontPage_Form1_Validator(theForm)
{
if (theForm.company_name.value == ""
{
alert("Please enter a value for the \"Company_name\" field."
theForm.company_name.focus();
return (false);
}
if (theForm.company_add.value == ""
{
alert("Please enter a value for the \"company_add\" field."
theForm.company_add.focus();
return (false);
}
if (theForm.con_per.value == ""
{
alert("Please enter a value for the \"Con_per\" field."
theForm.con_per.focus();
return (false);
}
if (theForm.con_no.value == ""
{
alert("Please enter a value for the \"con_no\" field."
theForm.con_no.focus();
return (false);
}
return (true);
}
Any help much appreciated
Thanks<font size=3></font id=size3>
Replies
Replied 10 Jan 2006 11:27:25
10 Jan 2006 11:27:25 Lee Diggins replied:
Hi
The best way to achieve this for server-side validation is to get the form to post back to itself. You can then do a check to see if the form has been posted, add the validation code and any error messages you need to have displayed, also if the form passes validation you can process the data in the normal way then redirect to a confirmation page or wherever you want.
If this is what you're after, then post back here, if not then post back.
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
The best way to achieve this for server-side validation is to get the form to post back to itself. You can then do a check to see if the form has been posted, add the validation code and any error messages you need to have displayed, also if the form passes validation you can process the data in the normal way then redirect to a confirmation page or wherever you want.
If this is what you're after, then post back here, if not then post back.
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
Replied 17 Jan 2006 14:43:55
17 Jan 2006 14:43:55 likez praise replied:
this code really works, but i want it to covert it to vbscript.... had no idea on vbscript language
Replied 17 Jan 2006 15:42:11
17 Jan 2006 15:42:11 Lee Diggins replied:
But this is client -side, are you saying you want vbscript client-side too? You do know you're limited to using vbscript client-side in IE?
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>