Author |
Topic |
|
Gargoyle
Junior Member
USA
280 Posts |
Posted - 15 December 2004 : 22:11:07
|
I am trying to create a link for users to click to private message me their answers to a contest. I would like the link to "Automatically" insert the subject as well as my name. This is what I have so far ----
privatesend.asp?method=Topic&mname=Gargoyle
I just need to know what I need to add to it to make this link fill out the subject field as well. Anyone done this before ?? |
Here is a link to my Snitz powered Drag Racing site. |
|
rasure
Junior Member
289 Posts |
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 16 December 2004 : 11:04:32
|
I tested this real quickly with just hard coding something into the right place. It should work just fine with a variable.
Around line 161 in privatesend.asp find the following code:
if strRqMethod = "Topic" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Subject:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input maxLength=""50"" name=""Subject"" value=""" & Trim(ChkString(TxtSub,"display")) & """ size=""50""></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
Change it to look like this:
Dim strPMSubject
strPMSubject = Request.QueryString("mname")
if strRqMethod = "Topic" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Subject:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input maxLength=""50"" name=""Subject"" value=""Contest Answers:" & strPMSubject & """ size=""50""></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
Change the code in red as you see fit, and that ought to get you working. |
Bill Parrott Senior Web Programmer, University of Kansas Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com) Personal Website (www.chimericdream.com) |
|
|
Gargoyle
Junior Member
USA
280 Posts |
|
PeeWee.Inc
Senior Member
United Kingdom
1893 Posts |
Posted - 16 December 2004 : 20:34:16
|
you'll have to edit the code no matter what |
De Priofundus Calmo Ad Te Damine |
|
|
rasure
Junior Member
289 Posts |
Posted - 16 December 2004 : 21:16:05
|
Ok I think I've figured it out, tried it on my forums and works great
Replace the code in red...
if strRqMethod = "Topic" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Subject:</b></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input maxLength=""50"" name=""Subject"" value=""" & Trim(ChkString(TxtSub,"display")) & """ size=""50""></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if with...
& Request.Querystring("subject") & then to fill in the subject field as a hyperlink use...
privatesend.asp?method=Topic&mname=rasure&subject=test pm I suppose you could even go as far as filling in the message field too if needed. |
Psychic & Spiritual Development Resources |
Edited by - rasure on 16 December 2004 21:21:05 |
|
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 17 December 2004 : 01:21:10
|
Glad you got it working. |
Bill Parrott Senior Web Programmer, University of Kansas Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com) Personal Website (www.chimericdream.com) |
|
|
Gargoyle
Junior Member
USA
280 Posts |
|
rasure
Junior Member
289 Posts |
Posted - 17 December 2004 : 19:26:49
|
quote: Originally posted by Gargoyle
I edited the code a bit more to allow a message to be inserted from the link as well.
What changes did you make to use the message field as well? just for reference |
Psychic & Spiritual Development Resources |
|
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 17 December 2004 : 22:04:47
|
Around line 196, find this line:
" <td bgColor=""" & strPopUpTableColor & """><textarea cols=""45"" name=""Message"" rows=""8"" wrap=""VIRTUAL"" onselect=""storeCaret(this);"" onclick=""storeCaret(this);"" onkeyup=""storeCaret(this);"" onchange=""storeCaret(this);"">" & Trim(CleanCode(TxtMsg)) & "</textarea></td>" & vbNewLine & _ Change the red text the same way you did the other one to suit your needs. |
Bill Parrott Senior Web Programmer, University of Kansas Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com) Personal Website (www.chimericdream.com) |
|
|
rasure
Junior Member
289 Posts |
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 18 December 2004 : 01:23:42
|
You're welcome. |
Bill Parrott Senior Web Programmer, University of Kansas Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com) Personal Website (www.chimericdream.com) |
|
|
|
Topic |
|