Jump to content

Game Design Help


Danny620

Recommended Posts

Hi

 

I have a set of text fields and i would like to do some vaildation on them e.g

 

textbox 1 = 100

textbox 2 = 200

textbox 3 = 300

 

and i would like the user to not go over there soilder limit so say i have 100 of soilders in the db and 200 spear fighter then the first textbox 1 would pass and so would the second put wot if the user put more troops in textbox 3 that they did'tn really have how do i stop the user from entering more troops than they should have thanks.

 

Link to comment
Share on other sites

Do a little javascript / ajax / php combo here...

 

on each key up, using ajax / php check ur database to make sure that the # is not greater then the person has in the database table, and if it exceeds you can then use javascript to 1. warn the user via alert and 2. clear the text box or reset it to the max # the user can use.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.