SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast sabret00the's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    radio button submits form

    i've seen a few forms about (across the years) in which when you select a radio button the form submits, however now that i'm actually looking to do something similar i can't find either a tutorial or a code snippet, can someone point me in the right direction please as i fear the issue is with my search terms.

    got some help, i was after
    PHP Code:
    onclick="form.submit()" 
    Last edited by sabret00the; Jul 24, 2006 at 04:37.

  2. #2
    SitePoint Evangelist vikrantkorde's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai, India
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use this.form.submit();
    Vikrant Korde
    S Y S T I M E, Mhape,
    Mumbai, Maharashtra, India.

  3. #3
    SitePoint Enthusiast sabret00the's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, what's the difference between form.submit and this.form.submit()?

  4. #4
    SitePoint Evangelist vikrantkorde's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai, India
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually there is no difference.
    but when you say this.form then it indicates that the current object's form's submit function.

    but actually form.submit() also does the same but sometimes it may fail.
    and this.form.submit() will not fail.
    Vikrant Korde
    S Y S T I M E, Mhape,
    Mumbai, Maharashtra, India.


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
  •