Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

form validation (unique num prefs)

Status
Not open for further replies.
Joined
Jan 19, 2007
Posts
2,207
Reaction score
47
This has been hurting my brain for a while - please help if you can.

I have a form that is constructed by php based on the number of items there are in a table (mysql).

The form is basically a way for me to collect user's preferences and store them in a database.

I don't know the number of options there'll be, because php finds this number out and then lists the items in a form with a small text box next to each item.
All of this works so far.

I want people to just enter a number value next to each title to indicate their preference. So if there were 15 items, users would enter 1-15 in their order of preference.

The problem is that I need validation that wont allow the form to be submitted if there are blanks, duplicates and the numbers entered must go from 1 to (however many number of items there are in the table in the db).

If anyone can help me with this I'd really appreciate it.
 
Status
Not open for further replies.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom