navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Select DB Entry To Edit

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Select DB Entry To Edit
Page: [1]
 
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
Select DB Entry To Edit - 6/22/2004 15:57:09   
As my work of art begins to take a pleasant shape with the help of you guys, I come to you with another question. Hopefully this will be as easy as my last one.

When I create my DB editor using FP2003, the default "list.asp" page it generates makes the ID numbers hyperlinks to Bring up the details of the entry selected.

I am wondering if it's possible to use a drop down instead of this list method. All the entries in this table the editor is for are pretty much information regarding a unique column for each entry.

What I would like to happen is that instead of hype-linking the ID, I'd like to do a "on select" from the drop-down box method to bring up the entry details. Is this possible to do?

Thanks for all your previous help,

JB
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: online

 
RE: Select DB Entry To Edit - 6/22/2004 16:18:14   
Sounds simple enough. The question is how much will FP 2003 do for you and how much do you have to do yourself. When you click a hyperlink in List.asp, do you get directed to a new page or do you stay on List.asp?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Aelaron)
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
RE: Select DB Entry To Edit - 6/22/2004 22:55:00   
When I click on the hyperlink in one frame, it opens a page, details.asp, in a different frame.

JB

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: online

 
RE: Select DB Entry To Edit - 6/22/2004 23:13:39   
So, seems to me all you have to do is create a page with a dropdown, as you suggest, and have the form that contains the dropdown submit to details.asp.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Aelaron)
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
RE: Select DB Entry To Edit - 6/22/2004 23:36:26   
I created a form with a dropdown filled with the information in my unique column. I assume I got to form properties and select "Send to other" and have Custom ISAPI, NSAPI, CGI, or ASP Script selected. Then uder options I have action: details.asp and method: POST.

Am I on the right track so far?

If so, when I click on the selection in the dropdown nothing happens. Am I missing something else or have I gone down the wrong path all together?

Thanks,

JB

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: online

 
RE: Select DB Entry To Edit - 6/23/2004 8:52:29   
Sounds like you are on the right track. You now need to enter some code to allow the dropdown to submit on change. Here is an example from a page I have that does something similar:

<select NAME="Operation" SIZE="1" onchange="submit()">

Add the bolded portion to your code.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Aelaron)
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
RE: Select DB Entry To Edit - 6/23/2004 14:13:53   
OK. It now submits, but nothing appears on my detail.asp page.

When FP2003 created my detail.asp page, is there something that is specifically looking for the posted data from the list.asp page?

Thanks again for the help,

JB

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: online

 
RE: Select DB Entry To Edit - 6/23/2004 14:18:04   
What is the code for detail.asp? The WHERE clause on that page should tell you what field it's looking for. You probably could even change the WHERE clause so it corresponds to your dropdown and then save the page as detail2.asp and then change your form so it submits to detail2.asp.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Aelaron)
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
RE: Select DB Entry To Edit - 6/24/2004 16:12:11   
Well Here's the current code generated by FP2003 for my detail.asp:

<%
fp_sQry="SELECT * FROM ""Reticle Status"" WHERE ID = ::ID::"
fp_sDefault="ID=0"
fp_sNoRecords="No records returned."
fp_sDataConn="PLY_SQL"
fp_iMaxRecords=1
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&Process=202&Reticles=202&Product=202&ETA from IMO=202&Type=202&Status=202&SCX04=202&SNA08=202&SNA10=202&SNA12=202&SNA14=202&SAA02=202&SAA06=202&"
fp_iDisplayCols=14
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>

I assume I need to change the line "fp_sQry="SELECT * FROM ""Reticle Status"" WHERE ID = ::ID::" " To say WHERE (my drop down box name) = :: (The item selected in drop down box)::.

When I do that, FP2003 automatically changes it back to the above form and tells me that an area automatically created by front page has been changed and will be returned to it's original form upon saving.

JB

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: online

 
RE: Select DB Entry To Edit - 6/24/2004 18:22:27   
That's where the Spooky Diet comes in. A link is below in my signature. What the diet does is delete the webbots that undo your changes so you can then freely edit the red asp code. Give it a whirl.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Aelaron)
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
RE: Select DB Entry To Edit - 6/27/2004 12:58:15   
OK, diet applied. (That macro sure makes it easy)

However, still no joy.

Here's my list.asp code:

<form name="form_list" target="_self" action="detail.asp" method="POST" OnClick="OnClickBtn(this)">
	<table>	
	<td>
		<p><input name="btnAction" type="submit" value="Add New Record" OnClick="OnClickBtn(this)"></p>
	</td>
	<td>
		<p><input name="btnAction" type="submit" value="Delete Selected Records" OnClick="OnClickBtn(this)"></p>
	</td>
</table>

<hr>

	<p><nobr>
	<!--#include file="../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Reticle_Status"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="PLY_SQL"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="Reticles"
fp_sMenuValue="Reticles"
fp_sColTypes="&ID=3&Process=202&Reticles=202&Product=202&ETA_from_IMO=202&Type=202&Status=202&SCX02=202&SCX04=202&SNA08=202&SNA10=202&SNA12=202&SNA14=202&SAA02=202&SAA04=202&SAA06=202&"
fp_iDisplayCols=16
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<select NAME="Reticles" SIZE="1" onchange="submit()">
	<!--#include file="../../../_fpclass/fpdbrgn1.inc"-->
	
	<option><%=FP_FieldHTML(fp_rs,"Reticles")%></option>
	<!--#include file="../../../_fpclass/fpdbrgn2.inc"-->
	</select></nobr></p>


And here is my detail.asp code:

<%
fp_sQry="SELECT * FROM Reticle_Status WHERE Reticles = ::Reticles::"
fp_sDefault="Reticles="""""
fp_sNoRecords="No records returned."
fp_sDataConn="PLY_SQL"
fp_iMaxRecords=1
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&Process=202&Reticles=202&Product=202&ETA_from_IMO=202&Type=202&Status=202&SCX02=202&SCX04=202&SNA08=202&SNA10=202&SNA12=202&SNA14=202&SAA02=202&SAA04=202&SAA06=202&"
fp_iDisplayCols=16
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../../_fpclass/fpdbrgn1.inc"--><table BORDER=0>

<tr>
<td><b><font size="2">ID:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"ID")%></td>
</tr><tr>
<td><b><font size="2">Process:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"Process")%></td>
</tr><tr>
<td><b><font size="2">Reticles:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"Reticles")%></td>
</tr><tr>
<td><b><font size="2">Product:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"Product")%></td>
</tr><tr>
<td><b><font size="2">ETA_from_IMO:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"ETA_from_IMO")%></td>
</tr><tr>
<td><b><font size="2">Type:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"Type")%></td>
</tr><tr>
<td><b><font size="2">Status:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"Status")%></td>
</tr><tr>
<td><b><font size="2">SCX02:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"SCX02")%></td>
</tr><tr>
<td><b><font size="2">SCX04:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"SCX04")%></td>
</tr><tr>
<td><b><font size="2">SNA08:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"SNA08")%></td>
</tr><tr>
<td><b><font size="2">SNA10:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"SNA10")%></td>
</tr><tr>
<td><b><font size="2">SNA12:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"SNA12")%></td>
</tr><tr>
<td><b><font size="2">SNA14:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"SNA14")%></td>
</tr><tr>
<td><b><font size="2">SAA02:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"SAA02")%></td>
</tr><tr>
<td><b><font size="2">SAA04:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"SAA04")%></td>
</tr><tr>
<td><b><font size="2">SAA06:</font></b></td>
<td>
<%=FP_FieldVal(fp_rs,"SAA06")%></td>
</tr>


	<tr><td><table>
	<tr>
	<td>
	
	<form method="POST" action="edit.asp">
	<input type="hidden" name="ID" value="<%=FP_FieldHTML(fp_rs,"ID")%>">
	<p><input type="submit" value=" Edit " name="B1"></p>
	</form>
	</td>

	<td>
	<form method="POST" action="delete.asp">
	<input type="hidden" name="ID" value="<%=FP_FieldHTML(fp_rs,"ID")%>">
	<p><input type="submit" value="Delete" name="B1"></p>
	</form>
	</td>
	</tr>
	</table></td></tr>

</table>

<!--#include file="../../../_fpclass/fpdbrgn2.inc"-->


I am assuming that the code I have pasted here is the pertinant code to what I am trying to accomplish. If you don't see what you are expecting to see here, please let me know.

Thanks!

JB

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: online

 
RE: Select DB Entry To Edit - 6/27/2004 13:36:10   
Appears from your code that reticles is a text field. Therefore, the SQL in your second code snippet should be:

fp_sQry="SELECT * FROM Reticle_Status WHERE Reticles = '::Reticles::'"

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Aelaron)
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
RE: Select DB Entry To Edit - 6/27/2004 13:56:44   
Change made....no luck :(

Since my database is an SQL 2003 DB, should there be some syntax that is different?

JB

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: online

 
RE: Select DB Entry To Edit - 6/27/2004 14:04:50   
Are you getting an error message? If so, what is it. If not, what is happening?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Aelaron)
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
RE: Select DB Entry To Edit - 6/27/2004 14:14:45   
I am not getting any error messages at all.

The drop down list works great. When I select the item in the list the list.asp page "submits" but the detail.asp in the frame below does nothing at all. It just displays "no records selected".

JB

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: online

 
RE: Select DB Entry To Edit - 6/27/2004 14:20:23   
OK. Keep in mind I am not a frames expert by any means, but try this. Find this line:

<select NAME="Reticles" SIZE="1" onchange="submit()">

and change it to:

<select NAME="Reticles" SIZE="1" onchange="form_list.submit()">

I would have created a new, non-frames page to put the dropdown on and had the form on the new page submit to details.asp.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Aelaron)
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
RE: Select DB Entry To Edit - 6/27/2004 14:31:27   
OK...no luck with that little twist to the code.

One note. On my list.asp page I also have a button for "add new record" as you can probably see in my code. This button functions correctly and calls the new.asp to appear in the detail frame.

Once I have done this and then make the drop down selection, the detail.asp does not replace the new.asp in the detail frame.

I'm going to go ahead and make a detail2.asp as you recommended and see if I can at least get the page to publish the requested record.

I think that once I get that to happen, it's just a matter of figuring out where the "target = " call is made from.

Thanks again for your help.

JB

(in reply to BeTheBall)
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
RE: Select DB Entry To Edit - 6/27/2004 15:06:22   
As mentioned at the very beginning of this thread, the select page that FP2003 DIW created used an html link to call the particular record on detail.asp.

Here's the code that it is using to make the call:

<td><a href="detail.asp?ID=<%=FP_FieldURL(fp_rs,"ID")%>" target="detail">

I can't seem to figure out how this would fit in the current code I have for list.asp.

JB

(in reply to Aelaron)
Aelaron

 

Posts: 223
Joined: 6/8/2004
Status: offline

 
RE: Select DB Entry To Edit - 6/27/2004 18:30:59   
Welp...I have abandoned the frames. Instead I used an HTML link from my query page and it works great. I never could get the drop down thing to work, but I will have to look at that another time.

Thanks for the help, betheball.

JB

(in reply to Aelaron)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: online

 
RE: Select DB Entry To Edit - 6/30/2004 23:19:11   
Hey JB. I played with this a little and finally had some success. Try having the dropdown in a separate form from the other buttons. The code for the form being something like:

<form method="POST" action="detail.asp" Name="MyForm" target="detail">
<!--#include file="../../../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM Reticle_Status"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="PLY_SQL"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="Reticles"
fp_sMenuValue="Reticles"
fp_sColTypes="&ID=3&Process=202&Reticles=202&Product=202&ETA_from_IMO=202&Type=202&Status=202&SCX02=202&SCX04=202&SNA08=202&SNA10=202&SNA12=202&SNA14=202&SAA02=202&SAA04=202&SAA06=202&"
fp_iDisplayCols=16
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<select NAME="Reticles" SIZE="1" onchange="MyForm.submit()">
<!--#include file="../../../_fpclass/fpdbrgn1.inc"-->

<option><%=FP_FieldHTML(fp_rs,"Reticles")%></option>
<!--#include file="../../../_fpclass/fpdbrgn2.inc"-->
</select>
</form>

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Aelaron)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Select DB Entry To Edit
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts