#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0

    Form Parsing


    I have managed to create this simple form, how do I parse info the user clicks on.

    Code:
    <form id='sampleform' method='post' action='myurl.com' >
       <p>
       Name: <input type='text' name='Name' />
       </p>
       <p>
       Email: <input type='text' name='Email' />
       </p>
    <input type="radio" name="subject" value="maths" /> &pound;10
    <input type="radio" name="subject" value="physics" /> &pound;5
    <input type="radio" name="subject" value="physics" /> &pound;3
    &pound;<input type='text' name='donate-amount' />
       <p>
       <input type='submit' name='Submit' value='Submit' />
       </p>
    </form>
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    the current radio buttons make no sense, because the value of the last two is the same. This makes them indistinguishable.

    Assign the buttons sensible values (like 10, 5, 3). In JavaScript, you can get the currently selected button by checking the checked attribute.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0
    Hello, thanks for this, yeah sorry they wont make sense, they are a bit of dummy code. I was just demonstrating the structure of the form. I think i need a javascript handler (has to be js, long story), thanks though.

IMN logo majestic logo threadwatch logo seochat tools logo