HighDots Forums  

creating a Delete button

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss creating a Delete button in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
TSQRandy
 
Posts: n/a

Default creating a Delete button - 03-01-2004 , 12:00 PM






hello and good morning

i was just wondering if anyone has ever created a delete button on a page that
has a dynamic table.

You see, I created a dynamic table in DW MX 2004 with a list with columns such
as movie titles and id numbers, but also have a DELETE column designed in MS
Access 2002 to delete with checkboxes. at the bottom of the table I have a
DELETE submit button.

The problem: is though that I have 0 coming up in the Delete column in the
dynamic table and a 1 coming up ( because I want to delete that one) and the
box is checked on my html page and in my Access table.
For some reason my DELETE submit button is not deleting any of the records,
even the one witht the 1 given.

Please if you could check my code to possibly to give me an idea, it would be
very helpful:
<table width="852" border="1">
<!--DWLayoutTable-->
<tr>
<td>Alert</td>
<td>EventNumber</td>
<td>RecordDate</td>
<td>EventTitle</td>
<td>DocTitle</td>
<td>Delete</td>
<td width="17"></td>
</tr>
<cfoutput query="rsvendoralert" startRow="#StartRow_rsvendoralert#"
maxRows="#MaxRows_rsvendoralert#">
<tr>
<td>#rsvendoralert.Alert#</td>
<td>#rsvendoralert.EventNumber#</td>
<td>#rsvendoralert.RecordDate#</td>
<td>#rsvendoralert.EventTitle#</td>
<td><a
href="/TSQdb/dblink/#rsvendoralert.DocTitle#.pdf">#rsvendoralert.DocTi tle#</a></
td>
<td><form action="" method="post" name="checkbox" id="checkbox">
<input type="checkbox" name="checkbox" value="checkbox">
#rsvendoralert.Delete#
</form></td>
<td></td>
</tr>
</cfoutput>
</table>

<p align="right">
<input name="recordDEL" type="submit" id="recordDEL" value="Delete">
</p>
</DIV>


Reply With Quote
  #2  
Old   
mrichmond
 
Posts: n/a

Default Re: creating a Delete button - 03-01-2004 , 02:22 PM






Your problem is that you have many forms defined on the page - one per checkbox
in fact.

And your delete button is not in any form.

You need to have the page look like this :

<form name="myform" action="myactionpage.cfm" method="post">
<cfoutput query="myquery">
<input type="checkbox" name="Deletebox#currentrow#">
</cfoutput>

<input name="recordDEL" type="submit" id="recordDEL" value="Delete">
</form>

Notice only 1 form. Multiple checkboxes - each with a unique name (also
notice that you do not want to use the reserved keyword checkbox as the name of
your checkbox and checkboxes have no value) Also notice that the submit button
is INSIDE the form.

Making all of these fixes should solve your problems.


Reply With Quote
  #3  
Old   
TSQRandy
 
Posts: n/a

Default Re: creating a Delete button - 03-04-2004 , 01:53 PM



thank you meagan for your direction of how to fix my having too many forms and
how to do a delete button. Unfortunately, since I am pretty new to macromedia ,
when I enter into my code what u gave me, I do not know if I did it the correct
way. I would be so very grateful if you could check my code below, because it
is not working:
<cfoutput query="rsvendoralert" startRow="#StartRow_rsvendoralert#"
maxRows="#MaxRows_rsvendoralert#">
<tr>
<td>#rsvendoralert.Alert#</td>
<td>#rsvendoralert.EventNumber#</td>
<td>#rsvendoralert.RecordDate#</td>
<td>#rsvendoralert.EventTitle#</td>
<td><a
href="/TSQdb/dblink/#rsvendoralert.DocTitle#.pdf">#rsvendoralert.DocTi tle#</a></
td>
<td>#rsvendoralert.Delete#
<form name="DELcheckbox" action="schedupdates1.cfm" method="post">
<cfoutput query= "rsvendoralert">
<input name="Deletebox#currentrow#" type="checkbox" value="">
</cfoutput>

<input name= "recordDEL" type="submit" id="recordDEL" value="Delete">
</form></td>
</cfoutput>
</table>

<p align="right">&nbsp; </p>
</DIV>




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.