Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Window Grab Current Record 1

Status
Not open for further replies.

tyleri

Programmer
Jan 2, 2001
173
US
I am developing a website that is for a realestate agency, and I have ASP pulling information from an Access database. Right now it is set up so that it shows all the house information in a table - then repeats itself for each record.

I need to setup a link within this table w/ the record info that opens a new window and can grab certain information from that particular record. How do I set it up so that the link will know which record to grab the information from?

Thanks!
 
Your first page displays most of the data for each house and you want a link that pops a new window with additional data? Or is it data that already exists in the asp page that you want to carry over or both?
If it's existing data, you could carry it over to the next page in the link itself. The link would be something like:

<a href=&quot;newhomepage.asp?bedrooms=3&bath=2>click here</a>

this way you're sending it to the second page. the second page would then just request the info like from a form, ie.

bedrooms = request(&quot;bedrooms&quot;)

If you have additional data you want to pull from the DB at that point, Access makes you set a primary key. Generally, if you don't set one, it creates an autonumber field. You could use that autonumber (record id) as your identifier and just pass across in the url as well, request it in and then use that variable in your sql statement to pull the correct info. Use the WHERE qualifier so:

sql = &quot;SELECT sqft, aircon, pool, fenced from homes_table WHERE id = '&quot;& id &&quot;'&quot;

hth
mb
:) &quot;Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!&quot;
Marvin the Martian
 
Thanks! So far that opened up my eyes a bit and is very hopeful. Now I'm stuck again.

I am having problems with the form. I click on the link and it says &quot;page not found&quot; etc. The link should be right. What in the 2nd page am I going to have to put?

What if I told you that the link has this:

<a href=&quot;register.asp?showdate=<%= rstSimple.Fields(&quot;showing_dt&quot;).Value %>&address=<%= rstSimple.Fields(&quot;Address&quot;).Value %>&quot; target=&quot;_new&quot;>REGISTER!</a>

but I go to my &quot;register.asp&quot; page (the 2nd page) and it is not coming up.

I want my Register.asp page to have 3 fields - the user's email address, phone number, and name.

I also want the form to grab the info showdate and address. Then I want this form to email to a certain address when SUBMIT is clicked.

DO you have any ideas how I would set this up? This is my first time and I can't seem to find any easy examples!
 
okay...first, check your form action and make sure it's:
action=&quot;register.asp&quot;
that way we're sure it's directed to the right place.

You might make it easier on yourself if you read the data from the db table into variables instead of trying to pull it into the href as the &quot; can get confusing. I'm not 100% sure this is right but try this:

<a href=&quot;register.asp?showdate=<%= rstSimple.Fields('showing_dt').Value %>&address=<%= rstSimple.Fields('Address').Value %>&target='_new'&quot;>REGISTER!</a>

Note what I did was to change the &quot; to ' except at the beginning and end of the href contents...may have been confusing to the 'puter. also looked like an & was missing before target.

Sounds like you want register to be a form with 3 fields that e-mails somewhere when submitted? It appears you're bringing the show date and address over from the 1st page and are requesting them to enter their e-mail on the second page. So you'd only have one input box on the second page.

You could make register.asp submit to itself when submit is clicked and have code in an if/then/else statement with a flag of some sort. So:

flag=0
flag=request(&quot;flag&quot;)
if flag <> 0 then
'code to send email
response.redirect &quot;confirmemailsentpage.asp&quot;
else
'code for register.asp include a hidden field for flag
<input type=&quot;hidden&quot; name=&quot;flag&quot; value=&quot;1&quot;>
end if

hth
mb
:)



&quot;Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!&quot;
Marvin the Martian
 
I think i get what you are saying, but i need a little more guidance! I am very inexperienced with forms AND asp - do you know any sample code (including the forms and asp integration stuff) that i can contruct this form mailer with? this stuff is pretty-much over my head, unfortunately.

thankx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top