Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

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 Codewalkers Forums Sponsor:
  #1  
Old February 20th, 2006, 06:32 PM
dbh67 dbh67 is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 90 dbh67 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 29 m 48 sec
Reputation Power: 2
Form validation, prevent duplicate entries

Hello-
I have a form with 20 radio button groups ("names"), each with 5 choices ("values"). Some choices are the same in more than one group, but the user is not supposed to select any one choice more than once. For example: group A may have choices a,b & c and group B may also have the choices a,b & c. The user should be NOT be able to select choice a for both button group a and group b. In other words each of the 100 possible choices should be unique. Is there a quick way using either php or javascript to pop-up a warning and stop the form submission if the user selects any choice more than once, without having to write code for each of the 100 possibilities? Thanks.

Reply With Quote
  #2  
Old February 20th, 2006, 11:48 PM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information. Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,945 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 5 h 58 m 47 sec
Reputation Power: 3
RE: Form validation, prevent duplicate entries

This would have to be javascript based to prevent form submission. Try searching for form validation. However it could be worth noting that if you do use javascript you may or may not want to make a php based checker aswell to make sure that everything went according to plan. Ill move this thread to clientside where it is better suited

Reply With Quote
  #3  
Old February 20th, 2006, 11:49 PM
System System is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Posts: 665 System User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Message Moved

Thread moved from 'PHP Coding' to 'Client Side Things' by Andrew.

Reason:

Reply With Quote
  #4  
Old February 21st, 2006, 10:43 AM
Doik's Avatar
Doik Doik is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: ger
Posts: 337 Doik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 53 m 25 sec
Reputation Power: 2
Send a message via ICQ to Doik
RE: Form validation, prevent duplicate entries

i personally would recommend a php solution, optional supported by JavaScript, since i can switch JS off, and submit the form regardless of any validation scripts.
A php validation is easily implemented by just walking through all submitted checkbox groups and checking via foreach() if the current value is somewhere in the other submitted groups ( in_array() )

Reply With Quote
  #5  
Old February 21st, 2006, 10:59 AM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information. Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,945 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 5 h 58 m 47 sec
Reputation Power: 3
RE: Form validation, prevent duplicate entries

yes but he did state he wanted to stop the form from being submitted. Php cannot do this, however php can provide a very good backup just incase.

Reply With Quote
  #6  
Old February 21st, 2006, 07:37 PM
Doik's Avatar
Doik Doik is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: ger
Posts: 337 Doik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 53 m 25 sec
Reputation Power: 2
Send a message via ICQ to Doik
RE: Form validation, prevent duplicate entries

uh-oh. i thought he meant "stop from being processed".
so, sorry, I misunderstood it

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Form validation, prevent duplicate entries


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT