Can and how can I use variables in the <a hre

Results 1 to 3 of 3

Thread: Can and how can I use variables in the <a hre

  1. #1
    j9 Guest

    Default Can and how can I use variables in the <a hre

    dynamically changing the href=mailto &#060;%email%<BR><BR>Is there a way to accomplish the following:<BR>&#060;td&#062;&#060;a href = "mailto:" + &#060;%=RecSet.Fields("Email_addr").value%&#062 ; &#062; background = "images/bg.gif" &#060;/a&#062;&#060;/td&#062;<BR><BR>This obviously doesen&#039t work. I have a page that publishes the results of a sql query and I want to show a graphic symbol at the end of a row that when clicked on will open the email with the "TO" line filled in the email address found in the record. <BR> <BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Can and how can I use variables in the <a

    You can use variables just fine.<BR><BR>&#060;A HREF="mailto:&#060;%=RecSet.Fields("Email_addr").v alue%&#062;"&#062;...&#060;/A&#062;<BR><BR>See, the server side code is inserted before the client-side code gets sent to the browser. So, when you do the above, the client receives:<BR><BR>&#060;A HREF="mailto:*the value of the variable*"&#062;...&#060;/A&#062;<BR><BR>Does this make sense? There are a couple of good article that talk about the difference between server and client side issues on 4Guys.

  3. #3
    Join Date
    Dec 1969
    Posts
    105

    Default RE: Can and how can I use variables in the <a

    Try this syntax.<BR><BR>&#060;td&#062;<BR> &#060;a href = "mailto:&#060;%=RecSet("Email_addr")%&#062;"&# 062; <BR> &#060;IMG SRC="images/bg.gif"&#062;&#060;/a&#062;<BR>&#060;/td&#062;<BR><BR>Hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •