Link to home
Start Free TrialLog in
Avatar of smsaleem
smsaleem

asked on

Using Flash Submit Button with POST method of ASP form object

Hi everybody!

I am working on ASP 3.0 with VBScript at backend for communication with SQL Server 2000.  The HTML scripting tool that I am using is Dreamweaver MX.

My login submit form, i.e. "Login.asp", has two text boxes, "LoginName" and "Password".  I want to post these fields to "LoginVerify.asp" which communicates with the SQL Server using:

conn.open strConnect, LoginName, Passowrd

When I use "Login.asp" form object's submit button the information is posted to the "LoginVerify.asp" but when I use Flash Button as a Submit button the information is not posted to "LoginVerify.asp".

Is there any way to use Flash (Dreamweaver MX) button as submit button?  The Flash button in Dreamweaver MX seems to accepts databounnd fields only.
SOLUTION
Avatar of webwoman
webwoman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's possible to submit a form made in flash, so your flash script could be wrong or your loginverify.asp page.

Can you post some code, and explain how you use the submit from flash.
Avatar of smsaleem
smsaleem

ASKER

I am not using Flash form.   I am trying to use Flash Button on ASP form.  Here is the code of submit from.  The JavaScript has been generated by DreamweaverMX.
________________________________________________________
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body>
<form action="LoginVerify.asp" method="post" name="form1" onSubmit="button2.swf;MM_validateForm('Password','','R');return document.MM_returnValue">
  <div align="center"></div>
  <table width="72%" border="0">
    <tr align="center">
      <td colspan="2"><font size="4" color="#07A9D8">Login</font> </td>
    </tr>
    <tr align="center">
      <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td width="41%">
        <div align="right">Login Name</div>
      </td>
      <td width="59%">
        <input type="text" name="LoginName" size="20">
      </td>
    </tr>
    <tr>
      <td width="41%">
        <div align="right">Password</div>
      </td>
      <td width="59%" bordercolor="0">
        <input type = "password" name="Password" size="20" >
      </td>
    </tr>
    <tr>
      <td colspan = "3">&nbsp;</td>
    </tr>
    <tr>
      <td colspan = "3">
        <div align="center">
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" name="Button2" width="100" height="20" id="Button2">
            <param name="BASE" value=".">
            <param name="BGCOLOR" value="">
            <param name="movie" value="button2.swf">
            <param name="quality" value="high">
            <embed src="button2.swf" width="100" height="20" base="."  quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" onsubmit="" name="Button2" loginname="LoginName" password="Password" ></embed></object>
        </div>
      </td>
    </tr>
    <tr>
      <td colspan = "3">
        <div align="center">

<input type="submit" name="Login" value="Login" >         
        </div>
      </td>
    </tr>
  </table>
</form>
</body>
</html>


The following is "LoginVerify.asp"
______________________________________________________

<%@ LANGUAGE = VBScript %>
<% option explicit  %>
<%  Response.Buffer = TRUE %>
<%  on error resume next %>
<html>
<head>
<title>LoginValidate</title>
</head>
<body>
<%
Dim strLoginName, strPassword
Dim objConn, objRs, conStr, query
dim source

strLoginName = Request.Form("LoginName")
strPassword  = Request.Form("Password")
set objConn = Server.CreateObject("ADODB.Connection")
conStr = "Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=MyCatalog;Data Source=MyComputer"

Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open conStr, strLoginName, strPassword
objRs.Open  "Select * from Guest", objConn

if objRs.EOF then
    objRs.Close
    objConn.Close
    Response.Redirect "LoginFailure.asp"
else
    response.Redirect("LoginSuccessful.asp")
end if
%>

</body>
</html>


Don't use a Flash button. You can't use Flash as a submit button. You can use a GRAPHIC, but not an OBJECT. Not the same thing at all.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It appears this question has been abandoned.

I will leave a recommendation in the Cleanup topic area that this question will be:

- Points to wboevink -

Please leave any comments here within the next seven days.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Wakie,
EE Cleanup Volunteer.
Thanks Wakie for your suggestion.

When the question was asked, i remember, there was no provision of point splitting.  Both webwoman and wboevink did not solve the problem, but they did their best.  I regard both of them high - webwoman for her experienced advice, and wboevink for his understanding to problem.  

Their answers were partial, so awarding any point to any individual only, was not justified.  Now that point splitting is available, i suggest this point division for the effort that they made :)

Wakie any comment ?
Wise move, thanks for closing your question :)