Jump to content

Very Basic form validation.


seventheyejosh

Recommended Posts

Hello all. I'm not too terrible well versed in javascript, although i am learning more everyday. I've poked around a bit online and havent been able to really find what im looking for.

 

Basically I have the following problem.

 

I have an <input type=text name=games>

 

and basically if someone submits the form with a "0" or "" in the games field, I need a confirm box to pop up asking them if they are sure they want to continue. If they say yes, it will submit the form with no furthor prompting. If they say cancel however, i need it to jump back to the form and allow them to continue.

 

I can sort of manage this. However, i also have an <input type=checkbox name=skip value=1>

and if this is checked and then the form is submitted, I need it to completely bypass the fact that 'games' may be "0" or "".

 

also, im not sure if it matters but my form's name is referee_schedule , my method is post , and my action is /index.php

 

Thanks very much in advance, im primarily a pHp programmer, but i'm trying to spice up my code.

 

Thanks!

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.