How to clear text fields in jpanel?

How to use if empty function in dynamic text fields?

  • here's my code for static text field: [code]function displayerror($fieldname, $errormsg) { global $errorcount; echo "Error for $fieldname: $errormsg "; $errorcount++; } function validateinput($data, $fieldname) { global $errorcount; $totalquiz=($_POST['totalquiz']); if(empty($data)) { displayerror($fieldname, "This field is required" . "<br>"); $errorcount=1; $retval=""; } else { $retval = trim($data); $retval = stripslashes($retval); if(!is_numeric($totalquiz)) { displayerror($fieldname, "This field should be numeric" . "<br>"); $errorcount=1; } } return($retval); } $totalquiz=validateinput($_POST['total… "Total # of quizzes"); if($errorcount>0) echo "please use the back button to re-enter the data" . "<br>"; else { echo $totalquiz; [/code] my problem is how can i apply this if my text fields are dynamic? let's say in my index.html there's a button that ask how many quiz are there. so if i put 2, 2 text fields are generate w/ name property ="quiz" how can i apply this array looping in the above codes? :|

  • Answer:

    May the following discussion thread of use to you http://www.webmasterworld.com/forum88/3490.htm

bernard at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.