margaux Posted March 27, 2012 Share Posted March 27, 2012 I'm using something very similar to this function to create a form, passing 4 arguments function create_form_input($name, $type, $errors, $label) I was under the impression that the last argument could be optional. I am using it to set an id for the select fields in my forms but do not need it for the text fields. <td><label for="moderation">Moderation</label></td> <td><?php create_form_input('skillLevel', 'select', $survey_errors, 'moderation')?></td> When I run the script, I get an error message for every field which has not passed the 4th argument - 'missing argument 4 for create_form_input(). Are all arguments mandatory, or how do I make it optional? Link to comment Share on other sites More sharing options...
Larry Posted March 27, 2012 Share Posted March 27, 2012 To make it optional, you assign it a value in the function definition. Link to comment Share on other sites More sharing options...
margaux Posted March 27, 2012 Author Share Posted March 27, 2012 perfect, thank you! Link to comment Share on other sites More sharing options...
Recommended Posts