This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

form fields not checked still send


  1. Seven
    Member

    Form Location:
    http://www.7hunters.net/machform/view.php?id=2

    Issue:

    This is the form we are working on. There are many checkboxes and when the form submits it sends the field data for the entire form. All I need is data regarding boxes that are checked.

    So instead of receiving the entire form back which looks garbled something like what is pasted below and not easily scanned, I simply need the data selected by the end user. Does that make sense? I tried searching the forum to find the solution but probably did not word my query correctly.

    Sample of return - which is basically the entire form:
    1) (NEW) Achieve Global Training For Managers
    2) Principles & Qualities of Genuine Leadership for Managers<BR>Tuesday, February 5, 8:30AM-12:30PM $45.00
    3) Providing Constructive Feedback<BR>Tuesday, February 12, 8:30AM-12:30PM $45.00
    4) Developing Others<BR>Tuesday, February 19, 8:30AM-12:30PM $45.00
    5) Correcting Performance Problems<BR>Tuesday, February 26, 8:30AM-12:30PM $45.00
    6) Conducting Performance Reviews<BR>Tuesday, March 4, 8:30AM-12:30PM $45.00
    7) (NEW) Achieve Global Training For All Employees
    8) Principles & Qualities of Genuine Leadership: All Employees<BR>Tuesday, March 11, 8:30AM-12:30PM $45.00
    9) Speaking to Influence Others<BR>Tuesday, March 25, 8:30AM-12:30PM $45.00 YES

    Posted 16 years ago #
  2. yuniar

    Ahh.. I see.

    Ok, if you would like to get the selected data only, edit your includes/helper-functions.php file.

    On line 414 - 417, you will find this code:

    foreach ($email_data as $data){
    	$email_body .= "{$i}) <b>{$data['label']}</b> {$data['value']} ";
    	$i++;
    }


    Replace the code above with this one:

    foreach ($email_data as $data){
    	if(empty($data['value'])){
    		continue;
    	}
    	$email_body .= "{$i}) <b>{$data['label']}</b> {$data['value']} ";
    	$i++;
    }


    That should do the trick.
    Let me know if you have any trouble.


    MachForm Founder

    Posted 16 years ago #
  3. Seven
    Member

    Thanks! Worked like a charm!

    Posted 16 years ago #

RSS feed for this topic

Reply