SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Germany
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple form check

    Hi there,

    I would like to do a simple check if a radio box has been selected.

    The form doesn't select any radio box by default, because I don't want to influence the users choice or let them submit the box at all without doing anything.

    The form is a simple 5 star rating which means there are 5 radio boxes and a submi button.

    Thanks for some help on this...

    Regards ASchweti

  2. #2
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hows this? DEMO
    From the English nation to a US location.

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Germany
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi awestmoreland,

    exactly what I was looking for. I just thought there would be an easier way to check instead of using a for() statement.

    Well, it works and I will use it

    Thanks for your help!!

    Regards ASchweti

  4. #4
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Glad it worked. I continued playing around and cameup with this too: Demo #2
    In this case, I've removed the submit button as it updates automatically when the selection is changed.

    It looks nice, but it may be totally useless


    Andy
    From the English nation to a US location.

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Germany
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Andy,

    you are right, this is really nice but in my case useless. I am programming a 5 star rating tool, so I count of course all votings and return an average

    Thanks anyway, especially because I was not aware that you made this example just to help me out.

    Best regards,

    ASchweti

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Germany
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Andy,

    may I ask you one more question regarding your script? I've come to the stage where I want to add my rating script into an actual page. I now face the problem that there are multiple items on one page which can be rated.

    Therefore the form check needs to handle multiple forms on the same page. I see two ways. First, name every form differently and having multiple scripts for checking.

    The second, which I prefer, would be to work somehow with an array and have just a single script, but I am not sure how to do that with JS.

    Do you have an ideas?

    Thanks very much,

    ASchweti


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
  •