SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    London
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Submit using an image

    Trying to submit using an image but displays same page and clears the input fields. Clicking submit triggers some VB validation which I know works fine and then sends back to page....
    Worked previously with a submit button but now trying an image. The reset button works well but no joy with submit???

    any ideas? here is the code....


    Response.Write "<form name='newTopic' method='post' onSubmit='return ValidateForm(this)'>"
    Response.Write "<input src='images/submit.gif' border='0' type='image' NAME='Action' VALUE='Submit'>"
    Response.Write "<a href=""javascript:if(document.newTopic.reset){document.newTopic.reset();}else{alert('We are sorry, but your browser does not support this function.')}"" onmouseout=""self.status='';return true;"" onmouseover=""self.status='Clear quick search';return true;""><img src='images/reset.gif' border='0' alt='Reset fields'></a></TD></TR>"
    Response.Write "</form>"

  2. #2
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    TRY on the image:

    <a href="#"><img src='images/submit.gif' border='0' alt='Submit Form' onClick="form.submit()"></a>

    Where "form" is the name of you form and the "#" means that when a mouse is over the image the usual pointer for a click thru will show.

    Have fun,

    a good site for javascript is: http://msdn.microsoft.com/library/default.asp

  3. #3
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sorry to shoot you

    I'm sorry to shoot you down seblb but what you
    are doing is really pointless.
    You are creating an extra href, an extra dom ref, an extra namespace, variable counter, elment event conrtol, virtual HTA etc (all just by putting an a href in!)

    All you want is a cursor.. well use css that's what it's there for! Also, using a # as a value in in an href without an onclick which returns false in the SAME tag will mean scrolling to the top of the element.
    This is really not the way to go!

    <img src='images/submit.gif"
    style="border:0;cursor:hand"
    onClick="document.all.form.submit()">
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  4. #4
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but that doesnt work in netscape, the image just comes up as an image

  5. #5
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    You're not wrong

    I don't write for Netscape.
    I have no tolerance for it at all.

    Try looking up the NN cursor style ref (if there is one)

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  6. #6
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just wanna say how easy it must be to claim 'flawless coding' when you are only coding for the easy browsers.

    Not much of a claim really, is it? (that's a rhetorical question. I already know the answer)
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  7. #7
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    depends on your point of view

    Well that depends really.
    I choose NOT to work on multi-browser code because i work in controlled environments.

    Let's just say the company i work for would go round the loop if i was coding for anything other than ie, or went out of my way to be nice to them.

    And as far as My work goes, if you have a problem with it, then please do say so, and i'll stop helping people, because i wouldn't want to insult your values by offering my inferior notions up against the infinate wisdom of client side scripting that you hold in your experience.

    let us all bath in the glory that is rendered onto us by the omnipotent being known only to us lesser mortals as ... "Bill Posters".

    I'd love, if you have time, for you to go through some of my other posts and give some more constructive critcism as to how i might better understand the techniques that i only attempt to employe!

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  8. #8
    SitePoint Zealot buono's Avatar
    Join Date
    Nov 2001
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "I choose NOT to work on multi-browser code because i work in controlled environments. "

    Then don't shoot people down.
    Last edited by buono; Mar 20, 2002 at 11:33.

  9. #9
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good point buono.
    However i had a point to make and wasn't questioning the underlying technique.

    I'm a professional, and take pride in my work.
    I get very angry at someone suggesting i don't know
    how to do my job.

    If you take a look, you'll see i help everyone i can, but don't ask any questions. I'd say that's fairly generous, and that's what this site is about... i don't do that to have someone then make a personal jab about my username and whether or not it's justified.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  10. #10
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No need to get out your pram, flawless.

    No-ones question that what you do, you do well.

    It's just that I mistakingly assumed (from your nik) that you were making a better job of operating under the same cross-browser (et al) pressures than most.
    I took the claim at face value. My mistake.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  11. #11
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No harm done.
    I'm sorry for snapping.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  12. #12
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no worries
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature


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
  •