Hi. I know there are quite a few threads here that deal with this subject, and I've tried everything I could find here, but have had no luck. I have a form that has a db backend. When the user enters a valid user/pwd combo they are allowed to view only certain items based upon their settings. My form has three buttons (VSI Rep, Media, Dealer). I am trying to make it so that if a user only has access to the dealer info, then pressing the VSI Rep and Media buttons will do nothing. But pressing the Dealer button will bring up a bunch of stuff for them. It seems I've got everything plugged in, but can't figure out how to pass the rep, media, dealer value to the next ASP program.
Here is my script:
<SCRIPT LANGUAGE="JavaScript1.2">
function ValidForm() {
if (document.form1.username.value == "" || document.form1.password.value == "") {
alert("Please enter user name and password.");
document.form1.username.focus();
return false;
}
else
return true;
}
</SCRIPT>
<script>
function doSubmit(btn)
{
document.form1.submit.value=btn;
document.form1.submit();
}
</script>
-----------------------------------------
Here is my form:
<FORM ACTION="VTmain.asp?Option=LogIn" NAME="form1" METHOD="post" ONSUBMIT="return ValidForm();">
<input type=hidden name=submit1 value="">
<TABLE BORDER="0" BGCOLOR="#FFFFFF" CELLPADDING="2">
<TR>
<TD ALIGN="RIGHT" COLSPAN="2"><B><FONT FACE="Arial, Helvetica">Enter your User ID:</FONT></B></TD>
<TD><INPUT TYPE="TEXT" NAME="username" SIZE="12" VALUE="<%= lcType %>-<%= lcRequest %>"></TD>
</TR>
<TR>
<TD ALIGN="RIGHT" COLSPAN="2"><FONT FACE="Arial, Helvetica"><B>Enter your Password:</B></FONT></TD>
<TD><INPUT TYPE="PASSWORD" NAME="password" SIZE="12"></TD>
</TR>
<TR>
<TD COLSPAN="3" ALIGN="CENTER"> </TD>
</TR>
<TR>
<TD ALIGN="CENTER" COLSPAN="3">
<TABLE WIDTH="350" BORDER="0" CELLPADDING="10" CELLSPACING="0" ALIGN="CENTER">
<TR>
<TD><input type="image" NAME="submit1" SRC="images/vsi-rep.gif" onclick="doSubmit('OSR')" ></TD>
<TD><input type="image" NAME="submit1" SRC="images/media.gif" onclick="doSubmit('Media')" ></TD>
<TD><input type="image" NAME="submit1" SRC="images/dealer.gif" onclick="doSubmit('Dealer')" ></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE></FORM>
-----------------------------
any assitance would be greatly appreciated.
Thanks, in advance!!
~ lahddah
Here is my script:
<SCRIPT LANGUAGE="JavaScript1.2">
function ValidForm() {
if (document.form1.username.value == "" || document.form1.password.value == "") {
alert("Please enter user name and password.");
document.form1.username.focus();
return false;
}
else
return true;
}
</SCRIPT>
<script>
function doSubmit(btn)
{
document.form1.submit.value=btn;
document.form1.submit();
}
</script>
-----------------------------------------
Here is my form:
<FORM ACTION="VTmain.asp?Option=LogIn" NAME="form1" METHOD="post" ONSUBMIT="return ValidForm();">
<input type=hidden name=submit1 value="">
<TABLE BORDER="0" BGCOLOR="#FFFFFF" CELLPADDING="2">
<TR>
<TD ALIGN="RIGHT" COLSPAN="2"><B><FONT FACE="Arial, Helvetica">Enter your User ID:</FONT></B></TD>
<TD><INPUT TYPE="TEXT" NAME="username" SIZE="12" VALUE="<%= lcType %>-<%= lcRequest %>"></TD>
</TR>
<TR>
<TD ALIGN="RIGHT" COLSPAN="2"><FONT FACE="Arial, Helvetica"><B>Enter your Password:</B></FONT></TD>
<TD><INPUT TYPE="PASSWORD" NAME="password" SIZE="12"></TD>
</TR>
<TR>
<TD COLSPAN="3" ALIGN="CENTER"> </TD>
</TR>
<TR>
<TD ALIGN="CENTER" COLSPAN="3">
<TABLE WIDTH="350" BORDER="0" CELLPADDING="10" CELLSPACING="0" ALIGN="CENTER">
<TR>
<TD><input type="image" NAME="submit1" SRC="images/vsi-rep.gif" onclick="doSubmit('OSR')" ></TD>
<TD><input type="image" NAME="submit1" SRC="images/media.gif" onclick="doSubmit('Media')" ></TD>
<TD><input type="image" NAME="submit1" SRC="images/dealer.gif" onclick="doSubmit('Dealer')" ></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE></FORM>
-----------------------------
any assitance would be greatly appreciated.
Thanks, in advance!!
~ lahddah