Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    simple button error I think?

    hey,

    I have a submit button like so:

    <form action="http://www.volconvo.com/index.php?act=Search&f="> <input type='image' height=16 name='submit'

    width=57 alt="advanced search" src="http://www.volconvo.com/advanced.gif" align='middle'

    /></form>

    and it won't go to the link for some reason...it shouldn't be this hard heh..

  • #2
    Regular Coder
    Join Date
    Dec 2002
    Location
    the windy city
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you seem to think that if you put an image into a <form> it will automatically act as a button, but it is not so. you just placed an image like any other image onto your web page. what you need to do is give your form a name and then add a onclick even to your image like this:

    <form action="http://www.volconvo.com/index.php?act=Search&f=" name="my_form">
    <input type='image' height=16 name='submit' width=57 alt="advanced search" src="http://www.volconvo.com/advanced.gif" align='middle' onclick="my_form.submit()" />
    </form>

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm..just tried that, and it didn't work...still takes me to a weird page: http://www.volconvo.com/index.php?su...36&submit.y=11

  • #4
    Regular Coder
    Join Date
    Apr 2003
    Location
    Atlanta, GA
    Posts
    487
    Thanks
    0
    Thanked 0 Times in 0 Posts
    According to the spec, DoubleV is quite plainly wrong. It is true, Ceen, if you had used an <img> tag, you'd need an onclick event trigger. With an <input type="image"> you should be fine.

    Do you have a demo page? I'm willing to bet the issue is your form's method crossing wires with the query-string variables in the form's action. Try method="post", or failing that, move the "?act=Search&f=" into two hidden inputs (name="act" value="Search"><input name="f"). That might do the trick.

  • #5
    Regular Coder
    Join Date
    Oct 2002
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Last edited by CeeN; 01-16-2004 at 08:41 PM.

  • #6
    Regular Coder
    Join Date
    Apr 2003
    Location
    Atlanta, GA
    Posts
    487
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't see your image-input for a search.

    Can you work up a small demo and see if you can localize the issue?

  • #7
    Regular Coder
    Join Date
    Dec 2002
    Location
    the windy city
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Choopernickel
    It is true, Ceen, if you had used an <img> tag, you'd need an onclick event trigger. With an <input type="image"> you should be fine.
    I was answering in a hurry and the fact that CeeN used <input type="image"> and not an <img> tag had completely bypassed me.
    sorry!

  • #8
    Regular Coder
    Join Date
    Oct 2002
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm..so how should I do this I have no idea what to do now lol

  • #9
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what is the point of having a form with only an image as input?
    couldn't you then just as well have an image tag surround by an anchor tag?

  • #10
    Regular Coder
    Join Date
    Oct 2002
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no, for some reason it doesn't line up that way with the other image...wow I didn't think it would be this hard heh


  •  

    Posting Permissions

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