Click to See Complete Forum and Search --> : Joining Words in a Text Field


danz321
05-06-2005, 11:16 AM
ok so ive updated a website for a recruitment agency i work at, so that the recruiters can add a job to there website, using a form which then submits all the data onto a database using ASP.

there's then a page on the main site that grabs all the info out the database and shows it on the page for all to see, like job hunters or somin.

the problem i have is this. when they click on "apply" it opens up an email, and i have made it to fill in the subject with the job title.

only thing is the job title has multiple words and i need to join them with %20 for them to display in the subject field in the email. i cant do this becuase im gettin the job title from the database.

Here's the code if you're confused..


Response.Write ("<a href=mailto:")
Response.Write (rsGuestbook("EmailAddress"))
Response.Write ("?subject=Application%20for%20")
Response.Write (rsGuestbook("JobTitle"))
Response.Write ("&body=Please%20attatch%20your%20CV%20to%20this%20email")
Response.Write (">Apply Here</a>")
Response.Write ("<br>")

The only way i can think to fix this is to either have a text field for each word in the job title in the origional job form. orrrr to use some script to join the text together. im guessing javascript is my best bet. hope someone can help me!!

thanks

dan

p.s

Someone said to use

Response.Write ("?subject=" & Server.URLEncode(JobTitle))

But that didnt work either :(

wmif
05-06-2005, 05:07 PM
if you just need to change the spaces to the %20 code, then use:

replace(rsGuestbook("JobTitle")," ","%20")

phpnovice
05-07-2005, 10:32 AM
Someone said to use

Response.Write ("?subject=" & Server.URLEncode(JobTitle))

But that didnt work either :(
No?!? :eek: Color me surprised. :D Perhaps it is just a problem of not having the totally enclosing quotes for the HTML HREF attribute. Try it this way:

url = "mailto:" & rsGuestbook.Fields("EmailAddress").Value & _
"?subject=Application for " & rsGuestbook.Fields("JobTitle").Value & _
"&body=Please attatch your CV to this email."
Response.Write "<a href=""" & Server.URLEncode(url) & """>Apply Here</a><br>" & vbCrLf

What is a "CV" anyway? ;)