Jump to content

Validating Checks, Select & Radios?


rofl90

Recommended Posts

use the in_array() function, and have php check that the value of the checkbox or radio button is an acceptable value. Here is an example from a form on my website.

 

$approx_pagesArray = array("1","2","3","4","5","6-10","11-15","16+","dont_know");

if(in_array("{$_POST['approx_pages']}", $approx_pagesArray)){

$approx_pages = urlencode($_POST['approx_pages']);

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.