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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Auto-Filler forms & Asp 2

Status
Not open for further replies.

tyleri

Programmer
Jan 2, 2001
173
US
Hey - I can't really describe this too well, and I'm new to this ASP-thing (heh) but what I want to do is on this link:


there is a "register" link next to every house, and i want that to grab the "address" field of the record and open a new smaller window which has a form that the user can enter their name & email address and email the registration form to the realtor. the hard part is grabbing the "address" field and including that in the email that the form sends.

Can anyone show me an example of working code? I really have had horrible luck on this.

Thanks,

Tyler
 
in the link put a querystring...

Code:
to-popup.asp?link=<%Response.Write(Request.ServerVariables(&quot;SCRIPT_NAME&quot;))%>

Then on your pop-up page you can request the querystring and add your complete url to it if you like..

Code:
Response.Write &quot;[URL unfurl="true"]http://www.premierrealtyinconline.com&quot;[/URL] & Request.QueryString(&quot;link&quot;)

www.vzio.com
ASP WEB DEVELOPMENT
 
Are you wanting to create the email yourself, or use something like Outlook.
I would say best to do the email yourself
 
Yup I want to do it myself...

snowboardr - I'm a little confused on where to put that. I am completely new to asp.

Do you know of a link or example that I might be able to look at? I think I understand the concept, I now just need the code formation for the entire form - I don't know how to bring in code from another page and insert it into a field in a form.

thanks, sorry i sound like an idiot ;)
 
Oh I noticed you just had a email link on that popup page.. put all the data you want to put in the subject of the email in multiple querystrings.. ie

Code:
pop-up.asp?home_id=34&Address=3455+lost+lane

Then in your email link:

Code:
mailto:blabla@somewhere.com?subject=<%Response.Write(QueryString(&quot;Address&quot;) & &quot;...&quot; & &quot;And whatever else in subject...&quot; %>
[code]

- Jason                         [b]www.vzio.com[/b]
                    ASP WEB DEVELOPMENT
 
Jason - I tried that code - and it gave me this error message:

Microsoft VBScript runtime error '800a000d'
Type mismatch: 'QueryString'
/rentals/register.asp, line 24

here is the code I used - can you help me w/ what I'm doing wrong? thanks!

<a href=&quot;mailto:ptran@premierrealtyinconline.com?subject=<%Response.Write(QueryString(&quot;Address&quot;))%>&quot;>
PTran@PremierRealtyIncOnline.com</a>
 
oops...

Request.QueryString(&quot;Address&quot;)

www.vzio.com
ASP WEB DEVELOPMENT



 
This looks like a dynamically built site so as the page is created tag on the end of the register link
&quot; & propertyaddress

then something like this named register.asp

<form method=&quot;POST&quot; action=&quot;mailsend.asp&quot;>
<%
subject=request(&quot;subject&quot;)
%>
Your Email Address <input type=&quot;text&quot; name=&quot;email&quot; size=&quot;20&quot;></p>
<p><textarea rows=&quot;20&quot; name=&quot;body&quot; cols=&quot;61&quot;></textarea></p>
<p><input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;B1&quot;><input type=&quot;reset&quot; value=&quot;Reset&quot; name=&quot;B2&quot;></p>
</form>

then use this called sendemail.asp to send the email

<%
Set Mail=server.CreateObject(&quot;cdonts.newmail&quot;)
Mail.From = request(&quot;email&quot;)
Mail.to = &quot;your address here&quot;
Mail.Subject = request(&quot;subject&quot;)
mail.body=request(&quot;body&quot;)
mail.send
mail.close
set mail=nothing
%>

probably as clear as mud! lol
 
Hey Gary - I tried your method - everything works swell until I use the &quot;mailsend.asp&quot; file. here is my error message:

Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object
/rentals/mailsend.asp, line 8

here is my code:

<%
Set Mail=server.CreateObject(&quot;cdonts.newmail&quot;)
Mail.From = request(&quot;email&quot;)
Mail.to = &quot;tyleri@comcast.net&quot;
Mail.Subject = request(&quot;subject&quot;)
mail.body= request(&quot;email&quot;)
mail.send
mail.close
set mail=nothing
%>

 
I believe it is Windows 2000. email me at tyleri@comcast.net it might be easier.
 
Have you got SMTP setup on teh server, if not then it wont work, if you can upload to your working server then it should work fine.
N.B. CDONTS doesnt work with XP

If you want an easy way to get this working and testing then checkout they have a free email component that pretty much sets itself up. The syntax is slightly different but well documented in examples.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top