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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New to Javasript

    Hi I am trying to make a form for a webpage I have managed some of the very basic stuff I now want to Add a set of radio buttons to the form to accept a level of entry such as High, Low or Medium Write a function that displays the level of entry to the user in an alert box so that the level can be confirmed or rejected. can anyone help

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,020
    Thanks
    56
    Thanked 566 Times in 563 Posts
    Yes. What are you stuck on specifically, please show us what you have done so far and when is your homework due?

  • #3
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I Have a couple of weeks to do this and this is where I have got to, just about understand what I have done so for
    <head >
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
    <title >Form Page: sampleform</title>
    </head>
    <body>
    <h1>Sample form page</h1>

    <form id='sampleform' method='post' action='' >
    <p>
    Name: <input type='text' name='Name' />
    </p>
    <p>
    Email: <input type='text' name='Email' />
    </p>
    <p>
    <input type='submit' name='Submit' value='Submit' />
    </p>
    this part adds radio buttons
    <p>
    <input type="radio" name="rating" value="high">High !!! <br/>
    <input type="radio" name="rating" value="Medium">Medium <br/>
    <input type="radio" name="rating" value="Low">Low <br/>
    </p>

    </form>

    </body>
    </html>

  • #4
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,020
    Thanks
    56
    Thanked 566 Times in 563 Posts
    zero javascript, huh?

    Well, to be honset you won't find many people here willing to do your entire assignment for you - it's not really in your best interests anyway. But here's a start - don't submit the form on a test page - you have nowhere to submit it to anyway, and all you end up doing is reloading the page.

    One way to do it is to loop through your radio buttons, find out which (if any) is checked, get the value of the checked one and compare it against whatever the entry level requirement is. To do that, you can make it easier on your self by giving the radio values numbers (3,2,1) instead of words like "high, medium, low"

  • #5
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    .. and an "alert" box doesn't let the user confirm or reject.. you'll want to use a confirm dialog, for that part.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".


  •  

    Posting Permissions

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