Click to See Complete Forum and Search --> : Problem using Flash Button as Submit button


senthilpr_in
07-28-2003, 05:09 PM
Hi all,

I have

1. dataentry.asp where the user can enter the data in a form
2. displayres.asp (the code is shown below) where I display the data, so that the user can go back to

the previous page (dataentry.asp) and make any corrections or else can write the entered data into the

database.

3. writetodb.asp to write the data submitted by form to the database.

The problem is when I enter the data in the first page (dataentry.asp) and submit, the user entered

information is correctly displayed in the page displayres.asp (code given below). But when I try to use

the flash submit button to either goto the previous page or next page, i get the following javascript

error.

Line: 1
Char: 1
Error: Object doesn't support this action
Code: 0
URL: http://localhost/patient%20info%20mgmt/displayres.asp

But if I refresh the asp page by hitting the refresh button, then try submitting the page, the page

gets submitted and my data gets written into the database.

The onclick events for the flash button are as follows

For writetodb.swf it is "javascript:window.document.validform.submit();"
For goback.swf it is "javascript:window.document.editform.submit();"

I have used similar onclick event for the flash submit button in the dataentry.asp page and it works

perfectly fine everytime.


<html>
<head>
<title>Review your information </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p><strong>Please Check the Information you have entered before Proceeding</strong></p>

<form name="editform" method="post" action="dataentry.asp">

<input name="lname" type="hidden" id="lname" value=<%

Response.Write(chr(34)&Request.Form("lname")&chr(34))%>>

<input name="fname" type="hidden" id="fname" value=<%

Response.Write(chr(34)&Request.Form("fname")&chr(34))%>>

....

....

....

<input name="followup" type="hidden" id="followup" value=<% if (Request.Form("followup")="checkbox")

Then
Response.Write("true")
Else
Response.Write("false")
End if
%> >
<input name="refered" type="hidden" id="refered" value="1">

</form>



<form name="validform" method="post" action="writetodb.asp">

<input name="lname" type="hidden" id="lname" value=<%

Response.Write(chr(34)&Request.Form("lname")&chr(34))%>>

<input name="fname" type="hidden" id="fname" value=<%

Response.Write(chr(34)&Request.Form("fname")&chr(34))%>>

....

....

....

<input name="followup" type="hidden" id="followup" value=<% if (Request.Form("followup")="checkbox")

Then
Response.Write("true")
Else
Response.Write("false")
End if
%> >

</form>

<table width="581" height="591" border="1" align="center" cellpadding="0" cellspacing="0"

bordercolor="#6699FF">

<tr>

<td width="577" height="589">
<table width="100%" border="0" cellpadding="0" cellspacing="4">
<tr>
<td width="100%" height="26" align="center" bgcolor="#6699FF">
<div align="left"><strong>Patient Information</strong></div></td>
</tr>
</table>

<table width="537" height="269" border="0" cellpadding="2" cellspacing="0">
<tr bordercolor="0">
<td width="176" height="26"> Last Name</td>

<td width="353"><%Response.Write(Request.Form("lname"))%> </td>
</tr>
<tr bordercolor="0">
<td width="176" height="26">First Name</td>

<td><%Response.Write(Request.Form("fname"))%> </td>
</tr>
<tr bordercolor="0">
<td width="176" height="26" nowrap>Middle Initial</td>

<td><%Response.Write(Request.Form("minitial"))%></td>
</tr>
<tr bordercolor="0">
<td width="176" height="26" nowrap>Medical Record No</td>

</tr>

....

....

....

<tr>
<td width="176" height="25">Follow Up Required ?</td>
<td> <% if (Request.Form("followup")="checkbox") Then
Response.Write("Yes")
Else
Response.Write("No")
End if
%> </td>
</tr>

</table>


<table width="537" border="0">
<tr>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"

width="100" height="23">
<param name="BGCOLOR" value="">
<param name="movie" value="writetodb.swf">
<param name="quality" value="high">
<embed src="writetodb.swf" quality="high"

pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"

type="application/x-shockwave-flash" width="100" height="23" ></embed>
</object></td>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"

width="100" height="23">
<param name="BGCOLOR" value="">
<param name="movie" value="goback.swf">
<param name="quality" value="high">
<embed src="goback.swf" width="100" height="23" quality="high"

pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"

type="application/x-shockwave-flash" base="" ></embed>
</object></td>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"

width="100" height="23">
<param name="BGCOLOR" value="">
<param name="movie" value="home.swf">
<param name="quality" value="high">
<param name="base" value=".">
<embed src="home.swf" base="." quality="high"

pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"

type="application/x-shockwave-flash" width="100" height="23" ></embed>
</object></td>
</tr>
</table>
<p>&nbsp;</p>

<div align="left">
</div>

</body>
</html>



Please Help

Thanks

Senthil