Forums

i can't crea a tables for my forms

realidea 26 Jun, 2011
hello
how are you all
i have a question
when i try to creat a database tables for my forms it gives me error
Fatal error: Call to a member function getError() on a non-object in /public_html/administrator/components/com_chronoforms/admin.chronoforms.php on line 534
somehow i tried to change that line to 300
JError::raiseWarning(300, $row->getError());
but no succsses
i have 89 field i have build in my application form
GreyHead 26 Jun, 2011
Hi RealIdea,

That looks like a bug to me. Please try changing the line to
JError::raiseWarning(100, $database->getError());


There's still a problem with saving the table but this should give you a more helpful error report.

Bob
realidea 26 Jun, 2011
thank you to tell me that is a bug
so how can i customize the template to show all the data entry that user fiil in the application instead of database now ?
You may customize this message under the "Template" tab in the Email settings box.
realidea 27 Jun, 2011
i read the FAQ

If we have a form with this code:
<input type="text" name="firstname"><br>
<input type="text" name="lastname"><br>
<input type="submit" value="submit">

We can create a custom template in the Email template field in the Form Code tab using the field names from our form in {. . .} brackets like this:
My client name is : {firstname} {lastname}


so... i copied this from my new application code;

<div class="ccms_form_element cfdiv_checkboxgroup" id="for_office_use_container_div">
<label>For Office Use</label>
<input type="checkbox" name="for_office_use[]" id="for_office_use_choice_1" title="" value="choice 1" class="">
<label for="for_office_use_choice_1">Medical form</label>
<input type="checkbox" name="for_office_use[]" id="for_office_use_choice_2" title="" value="choice 2" class="">
<label for="for_office_use_choice_2">Permission to go on Walks or Trips</label>
<input type="checkbox" name="for_office_use[]" id="for_office_use_choice_3" title="" value="choice 3" class="">
<label for="for_office_use_choice_3">Permission to be photographed /videotaped and published</label>
<input type="checkbox" name="for_office_use[]" id="for_office_use_choice_4" title="" value="choice 4" class="">
<label for="for_office_use_choice_4">Parent Guide</label>
<input type="checkbox" name="for_office_use[]" id="for_office_use_choice_5" title="" value="choice 5" class="">
<label for="for_office_use_choice_5">Birth Certificate</label>
<input type="checkbox" name="for_office_use[]" id="for_office_use_choice_6" title="" value="choice 6" class="">
<label for="for_office_use_choice_6">Copy of the parent or the responsible one ID card</label>
<input type="checkbox" name="for_office_use[]" id="for_office_use_choice_7" title="" value="choice 7" class="">
<label for="for_office_use_choice_7">Recent 5 passport photos</label>
<input type="checkbox" name="for_office_use[]" id="for_office_use_choice_8" title="" value="choice 8" class="">
<label for="for_office_use_choice_8">Registration Fees</label>
<div class="clear"></div><div id="error-message-for_office_use"></div></div><div class="ccms_form_element cfdiv_datetime" id="start_date_container_div"><label>Start date</label><input maxlength="150" size="16" class="cf_datetime_picker" title="" type="text" value="" name="startdate" />
<div class="clear"></div><div id="error-message-startdate"></div></div><div class="ccms_form_element cfdiv_textarea" id="note_container_div"><label>Note</label><textarea cols="45" rows="12" class="" title="" type="textarea" name="note"></textarea>
<div class="clear"></div><div id="error-message-note"></div></div>Personal InformationChild’s Name<div class="ccms_form_element cfdiv_text" id="first_container_div"><label>First</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="childname_first" />
<div class="clear"></div><div id="error-message-childname_first"></div></div><div class="ccms_form_element cfdiv_text" id="middle_container_div"><label>Middle</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="childname_middle" />
<div class="clear"></div><div id="error-message-childname_middle"></div></div><div class="ccms_form_element cfdiv_text" id="last_container_div"><label>Last</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="childname_last" />
<div class="clear"></div><div id="error-message-childname_last"></div></div><div class="ccms_form_element cfdiv_datetime" id="date_of_birth_container_div"><label>Date of Birth</label><input maxlength="150" size="16" class="cf_time_picker" title="" type="text" value="" name="date_of_birth" />
<div class="clear"></div><div id="error-message-date_of_birth"></div></div><div class="ccms_form_element cfdiv_text" id="religious_preference_container_div"><label>Religious Preference</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="religious_preference" />
<div class="clear"></div><div id="error-message-religious_preference"></div></div>Family Information<div class="ccms_form_element cfdiv_checkboxgroup" id="guardian_s_marital_status_container_div"><label>Guardian‘s Marital Status</label><input type="checkbox" name="guardians_marital_status[]" id="guardians_marital_status_choice_1" title="" value="choice 1" class="">
<label for="guardians_marital_status_choice_1">Married</label>
<input type="checkbox" name="guardians_marital_status[]" id="guardians_marital_status_choice_2" title="" value="choice 2" class="">
<label for="guardians_marital_status_choice_2">Separated</label>
<input type="checkbox" name="guardians_marital_status[]" id="guardians_marital_status_choice_3" title="" value="choice 3" class="">
<label for="guardians_marital_status_choice_3">Divorced</label>
<input type="checkbox" name="guardians_marital_status[]" id="guardians_marital_status_choice_4" title="" value="choice 4" class="">
<label for="guardians_marital_status_choice_4">Widowed</label>
<div class="clear"></div><div id="error-message-guardians_marital_status"></div></div><div class="ccms_form_element cfdiv_text" id="father_s_guardian_s_name_container_div"><label>Father’s/Guardian’s Name</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="Father_guardians_name" />
<div class="clear"></div><div id="error-message-Father_guardians_name"></div></div><div class="ccms_form_element cfdiv_text" id="address_container_div"><label>Address</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="fathers_guardians_adress" />
<div class="clear"></div><div id="error-message-fathers_guardians_adress"></div></div><div class="ccms_form_element cfdiv_text" id="city_container_div"><label>City</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="fathers_guardians_city" />
<div class="clear"></div><div id="error-message-fathers_guardians_city"></div></div><div class="ccms_form_element cfdiv_text" id="home_phone_container_div"><label>Home Phone</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="fathers_guardians_homephone" />
<div class="clear"></div><div id="error-message-fathers_guardians_homephone"></div></div><div class="ccms_form_element cfdiv_text" id="work_container_div"><label>Work</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="fathers_guardians_workphone" />
<div class="clear"></div><div id="error-message-fathers_guardians_workphone"></div></div><div class="ccms_form_element cfdiv_text" id="cell_container_div"><label>Cell</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="fathers_guardians_cellphone" />
<div class="clear"></div><div id="error-message-fathers_guardians_cellphone"></div></div><div class="ccms_form_element cfdiv_text" id="place_of_employment_container_div"><label>Place of Employment</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="place_of_employment" />
<div class="clear"></div><div id="error-message-place_of_employment"></div></div><div class="ccms_form_element cfdiv_text" id="mother_s_guardian_s_name_container_div"><label>Mother’s/Guardian’s Name</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="mothers_guardians_name" />
<div class="clear"></div><div id="error-message-mothers_guardians_name"></div></div><div class="ccms_form_element cfdiv_text" id="address_container_div"><label>Address</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="mothers_guardians_adress" />
<div class="clear"></div><div id="error-message-mothers_guardians_adress"></div></div><div class="ccms_form_element cfdiv_text" id="city_container_div"><label>City</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="mothers_guardians_city" />
<div class="clear"></div><div id="error-message-mothers_guardians_city"></div></div><div class="ccms_form_element cfdiv_text" id="home_phone_container_div"><label>Home Phone</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="mothers_guardians_homephone" />
<div class="clear"></div><div id="error-message-mothers_guardians_homephone"></div></div><div class="ccms_form_element cfdiv_text" id="work_container_div"><label>Work</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="mothers_guardians_workphone" />
<div class="clear"></div><div id="error-message-mothers_guardians_workphone"></div></div><div class="ccms_form_element cfdiv_text" id="cell_container_div"><label>Cell</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="mothers_guardians_cellphone" />
<div class="clear"></div><div id="error-message-mothers_guardians_cellphone"></div></div><div class="ccms_form_element cfdiv_text" id="place_of_employment_container_div"><label>Place of Employment</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="mothers_guardians_placeofelemnts" />
<div class="clear"></div><div id="error-message-mothers_guardians_placeofelemnts"></div></div><div class="ccms_form_element cfdiv_textarea" id="names_and_dates_of_birth_of_other_children_in_the_family_container_div"><label>Names and Dates of Birth of other children in the family</label><textarea cols="45" rows="12" class="" title="" type="textarea" name="names_and_dates_of_birth_of_other_children_in_the_family"></textarea>
<div class="clear"></div><div id="error-message-names_and_dates_of_birth_of_other_children_in_the_family"></div></div>Emergency Information<div class="ccms_form_element cfdiv_select" id="in_case_of_an_emergency_who_should_be_contacted_first__container_div"><label>In case of an emergency, who should be contacted first?</label><select size="1" class="" title="" type="select" name="In_case_of_an_emergency_who_should_be_contacted_first">
<option value="Mother">Mother</option>
<option value="Father">Father</option>
<option value="Other">Other</option>
</select>
<div class="clear"></div><div id="error-message-In_case_of_an_emergency_who_should_be_contacted_first"></div></div><div class="ccms_form_element cfdiv_text" id="if_other_container_div"><label>if Other</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="if_other" />
<div class="clear"></div><div id="error-message-if_other"></div></div>Please list the names and numbers of two people who can be contactedIf we are unable to reach you and your child is sick at school.<div class="ccms_form_element cfdiv_text" id="1_container_div"><label>1</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="people_who_can_be_contacted_1" />
<div class="clear"></div><div id="error-message-people_who_can_be_contacted_1"></div></div><div class="ccms_form_element cfdiv_text" id="relationship_container_div"><label>Relationship</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="people_who_can_be_contacted_1_friendship" />
<div class="clear"></div><div id="error-message-people_who_can_be_contacted_1_friendship"></div></div><div class="ccms_form_element cfdiv_text" id="phone_container_div"><label>Phone</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="people_who_can_be_contacted_1_phone" />
<div class="clear"></div><div id="error-message-people_who_can_be_contacted_1_phone"></div></div><div class="ccms_form_element cfdiv_text" id="2_container_div"><label>2</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="people_who_can_be_contacted_2" />
<div class="clear"></div><div id="error-message-people_who_can_be_contacted_2"></div></div><div class="ccms_form_element cfdiv_text" id="relationship_container_div"><label>Relationship</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="people_who_can_be_contacted_2_friendship" />
<div class="clear"></div><div id="error-message-people_who_can_be_contacted_2_friendship"></div></div><div class="ccms_form_element cfdiv_text" id="phone_container_div"><label>Phone</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="people_who_can_be_contacted_2_phone" />
<div class="clear"></div><div id="error-message-people_who_can_be_contacted_2_phone"></div></div>If medical care is necessary, call<div class="ccms_form_element cfdiv_text" id="doctor_s_name_container_div"><label>Doctor’s Name</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="If_medical_care_is_necessary_doctorname" />
<div class="clear"></div><div id="error-message-If_medical_care_is_necessary_doctorname"></div></div><div class="ccms_form_element cfdiv_text" id="phone_container_div"><label>Phone</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="If_medical_care_is_necessary_doctorphone" />
<div class="clear"></div><div id="error-message-If_medical_care_is_necessary_doctorphone"></div></div><div class="ccms_form_element cfdiv_text" id="hospital_name_container_div"><label>Hospital Name</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="If_medical_care_is_necessary_hospitalname" />
<div class="clear"></div><div id="error-message-If_medical_care_is_necessary_hospitalname"></div></div><div class="ccms_form_element cfdiv_text" id="phone_container_div"><label>Phone</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="If_medical_care_is_necessary_hospitalphone" />
<div class="clear"></div><div id="error-message-If_medical_care_is_necessary_hospitalphone"></div></div><div class="ccms_form_element cfdiv_text" id="dentist_s_name_container_div"><label>Dentist’s Name</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="If_medical_care_is_necessary_dentistname" />
<div class="clear"></div><div id="error-message-If_medical_care_is_necessary_dentistname"></div></div><div class="ccms_form_element cfdiv_text" id="phone_container_div"><label>Phone</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="If_medical_care_is_necessary_dentistphone" />
<div class="clear"></div><div id="error-message-If_medical_care_is_necessary_dentistphone"></div></div>Medical History<div class="ccms_form_element cfdiv_checkboxgroup" id="does_your_child_have_any_allergies__container_div"><label>Does your child have any allergies?</label><input type="checkbox" name="does_your_child_have_any_allergies[]" id="does_your_child_have_any_allergies_yes" title="" value="Yes" class="">
<div class="ccms_form_element cfdiv_submit" id="submit_container_div"><input name="submit" class="" value="Submit" type="submit" />
<div class="clear"></div><div id="error-message-submit"></div></div>

it is just the half of code
i will do like the FAQ

name="firstname"


what about the other codes like checkbox and radio button and the others
sorry i did a big job with chronoforms but its the first time i meet this email template
so i need some explanation for how to code it
spicialy when i use 86 field in my form
all of them are different
how can i build the email template now ????!!!
GreyHead 27 Jun, 2011
Hi RealIdea,

Here is the first part of your Form HTML edited into an Email template.
<div class="ccms_form_element cfdiv_checkboxgroup" id="for_office_use_container_div">
    <label>For Office Use</label>{for_office_use}</label>
    <div class="clear"></div>
</div>
<div class="ccms_form_element cfdiv_datetime" id="start_date_container_div">
    <label>Start date</label>{startdate}
    <div class="clear"></div>
</div>
<div class="ccms_form_element cfdiv_textarea" id="note_container_div">
    <label>Note</label>{note}
    <div class="clear"></div>
</div>
Personal Information 
<div class="ccms_form_element cfdiv_text" id="first_container_div">
    <label>Child's Name</label>{childname_first} {childname_middle} {childname_last}
    <div class="clear"></div>
</div>

<div class="ccms_form_element cfdiv_datetime" id="date_of_birth_container_div">
    <label>Date of Birth</label>{date_of_birth}
    <div class="clear"></div>
</div>
<div class="ccms_form_element cfdiv_text" id="religious_preference_container_div">
    <label>Religious Preference</label>{religious_preference}
    <div class="clear"></div>
</div>
Family Information
<div class="ccms_form_element cfdiv_checkboxgroup" id="guardian_s_marital_status_container_div">
    <label>Guardian's Marital Status</label>{guardians_marital_status}
    <div class="clear"></div>
</div>
<div class="ccms_form_element cfdiv_text" id="father_s_guardian_s_name_container_div">
    <label>Father's/Guardian's Name</label>{Father_guardians_name}
    <div class="clear"></div>
</div>
<div class="ccms_form_element cfdiv_text" id="address_container_div">
    <label>Address</label>{fathers_guardians_adress}
    <div class="clear"></div>
</div>
<div class="ccms_form_element cfdiv_text" id="city_container_div">
    <label>City</label>{fathers_guardians_city}
    <div class="clear"></div>
</div>

Each input block in the Form HTML looks like this
<div class="ccms_form_element cfdiv_text" id="place_of_employment_container_div">
    <label>Place of Employment</label>
    <input maxlength="150" size="30" class="" title="" type="text" value="" name="place_of_employment" />
    <div class="clear"></div>
    <div id="error-message-place_of_employment"></div>
</div>
and can be replaced in the email template to replace the <input . . . > tag with {input_name} and to remove the error message tag which is no longer needed. The result is
<div class="ccms_form_element cfdiv_text" id="place_of_employment_container_div">
    <label>Place of Employment</label>{place_of_employment}
    <div class="clear"></div>
</div>
You can, of course use any other HTML or plain text layout that suit your purpose.

Note that checkbox arrays only need one {input_name} entry without the [] at the end. But you will need to drag a Handle Arrays action to the OnSubmit event to convert the result to a string that will display in the email.

Bob
realidea 28 Jun, 2011
thank you so much
if i need any help i will post
thank you
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger