Jump to content

Validation Function problem


genista

Recommended Posts

Hi all,

 

I have a form and I need to validate the input, the input however comes from html which is generated by php, rather than the static form at the bottom of our php scripts. If a condition is met a field appears allowing the user to enter some data, the field validation function then validates the data for bad characters etc. The problem is if the condition isn't met and the html is not being output the field validator complains of an undefined index.

 

From this code, how can I write this to check for something like isset?

 

//Check to set up values from the html:

$supplierid = isset($_POST['supplierid']) ? $_POST['supplierid'] : "";
$service1price = isset($_POST['service1price']) ? $_POST['service1price'] : "";

//now for the field validator
field_validator2("haircolourprice", $_POST["haircolourprice"], "number", 1, 9);
  field_validator2("service1price", $_POST["service1price"], "number", 1, 9);

 

Any help would be greatly appreciated,

 

 

G

Link to comment
https://forums.phpfreaks.com/topic/39287-validation-function-problem/
Share on other sites

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.