JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 19th, 2013, 06:52 AM
jelly46 jelly46 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 jelly46 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 48 sec
Reputation 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" /> £10
<input type="radio" name="subject" value="physics" /> £5
<input type="radio" name="subject" value="physics" /> £3
£<input type='text' name='donate-amount' />
   <p>
   <input type='submit' name='Submit' value='Submit' />
   </p>
</form>

Reply With Quote
  #2  
Old February 19th, 2013, 07:07 AM
Jacques1's Avatar
Jacques1 Jacques1 is online now
pollyanna
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2012
Location: Germany
Posts: 2,041 Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 6 Days 22 h 48 m 50 sec
Reputation Power: 812
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.

Reply With Quote
  #3  
Old February 19th, 2013, 09:16 AM
jelly46 jelly46 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 jelly46 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 48 sec
Reputation 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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Form Parsing (radio buttons)

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap