SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru redhillccwebmas's Avatar
    Join Date
    Jun 2005
    0 Post(s)
    0 Thread(s)

    Form elements - hotspot linking from within a form element

    Hi there,

    I have the following form code:-

    <FORM action= method=post>
    <INPUT type=hidden value=POK name=name>
    <INPUT type=hidden value=full3050 name=typefile>
    <INPUT type=hidden value=client name=redirect>
    <INPUT type=hidden value=0 name=notproper>
    <INPUT type=hidden value=0 name=emailreq>
    <INPUT type=hidden value=en name=language>
    <INPUT type=hidden value=OCTBONUS_05 name=campdefault>
    <INPUT type=image alt="Download Now!" src="" value="usandyou" border=0 name=submit>
    Currently when I click on the image, it is linked successfully to the download file through using this form interface. My problem is I basically need to do the same thing (linking to the download file) through a text-based hyperlink. Is there a way of doing this?

    In the context of what I am using the code for, I am wanting a user to download an executionable file located and processed from within the form action page URL

    I'm not too hot on forms as you can tell!

    Any help is very much appreciated

    Kind Regards


  2. #2
    SitePoint Enthusiast icovey's Avatar
    Join Date
    Jul 2006
    0 Post(s)
    0 Thread(s)
    Hey James,

    I give my forms an id then use the following bit of JS to submit forms using non <input> submit methods:

    HTML Code:
    function submitForm(form) {
    Then wrap the text in an <a> tag that includes an onclick event:

    HTML Code:
    <a href="#" onclick="submitForm('<form id>')">Link Text</a>
    Where <form id> is the id I have given to the form.

    Hope this helps. Cheers,

    7879 | Web Marketing Lichfield


Posting Permissions

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