SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dynamic href destination

    Hello,

    Anyone knows how to do a dynamic href destination based on a input value?

    I have a form that allows user to pick a picture (that shows a thumb preview presentation)...I'd like to do href to that picture in order to show it in full screen when clicked..
    I'm stuck on the dynamic reference to the href destination...

    >> the input I'd like to refer:
    <input type="file" name="picField" id="picField" onchange="preview(this)" size="10" >

    >> the href:
    <a href="javascript: form.picField.value" rel="lightbox" title=""><img src="spacer.gif" alt="Preview da imagem" name="previewField" border="0" id="previewField"></a>

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <a href="javascript:location.href=form.picField.value" rel="lightbox" title="">
    Saul

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    almost there

    the href is working now..but the rel="lightbox" don't...

    How can I pass the rel attribute on your suggestion?


Bookmarks

Posting Permissions

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