Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

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.
0
smsaleem
Asked:
smsaleem
  • 2
  • 2
  • 2
  • +1
2 Solutions
 
webwomanCommented:
Unless you want to alienate people, don't use Flash for ANYTHING that's critical. Not everybody has it, or has the right version, and if they don't, your form is useless.

If you know FOR SURE that everyone who may possibly access this has the right plug-ins, that there won't be any problems, and that you know EXACTLY how to make Flash do what you want, then go ahead.

But Flash is limiting for things like this. And while you can use an image as a submit button, if you want to use Flash to submit anything you're going to have to do it ALL in Flash -- not just part. Flash is a self-contained thing, NOT an image. You submit from Flash, you submit FROM FLASH -- NOT from your form.
0
 
Wouter BoevinkMasterCommented:
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.
0
 
smsaleemAuthor Commented:
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>


0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
webwomanCommented:
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.
0
 
Wouter BoevinkMasterCommented:
If you want to use flash you have to make the form in flash. Or in flash an action for the button.

Don't know flash to well but if you do this should be no problem.

button onpress url action "javascript:form.submit()"
0
 
WakieCommented:
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.
0
 
smsaleemAuthor Commented:
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 ?
0
 
WakieCommented:
Wise move, thanks for closing your question :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now