Form (multiple checkbox/select, Autoresponder)

5 replies · opened Feb 28, 2023

NnperroFeb 28, 2023

Hello,

I'm trying to make a form with a checkbox which we can select as many as we want.

I succeed to make a form and receive the mail to my company email address
but in the autoresponder email, it doesn't show the answers.

These two doesn't show any answers in autoresponder email.
contact-form-興味のあるオプショナルツアー[]
realestate-enquiry-projects[]

I prefer to use the checkbox than the multiple select.

ID and Password for the demo site are below.
ID :kagura
Password: kagura0980

If you need more information, please let me know.

【Form.html】


                                                興味のあるオプショナルツアー(複数回答可) 必須
                                                
                                                    
                                                        日本って何だろう?(3~4時間程度)
                                                    
                                                        日本って何だろう?(30分程度)
                                                    
                                                        お伊勢参り全部廻り
                                                
                                            
                                            
                                                Projects:
                                                
                                                    Future Apartments
                                                    Amazing Condo Groups
                                                    City Residency
                                                    Prime Housing Society
                                                    Kings Villa Groups
                                                
                                                
                                            

【Form.php】
$ar_message = !empty( $submits['ar_message'] ) ? $submits['ar_message'] :

【お名前】{contact-form-お名前}<br>
【フリガナ】{contact-form-ふりがな}<br>
【Email】{contact-form-email}<br>
【電話番号】{contact-form-電話番号}<br>
【ご希望の連絡方法】{contact-form-ご希望の連絡方法}<br>
【興味のあるオプショナルツアー】<br>
{contact-form-興味のあるオプショナルツアー[]}<br>
【伊勢旅行の予定 】<br>
{contact-form-伊勢旅行の予定}<br>
【相談内容】<br>
{contact-form-相談内容}<br>
【ご相談内容詳細】<br>
{contact-form-ご相談内容詳細}<br>
プロジェクト<br>
{realestate-enquiry-projects[]}<br>
SSemicolon WebSTAFFMar 7, 2023

Hello,

Thanks for your Kind Patience and Apologies for the Delays in replying!

Since the Multiple Checkbox is an Array, the standard input is currently not designed to work with the Default Settings. We will release an update soon to address this. Meanwhile, you can find the following code in the include/form.php File:
[ch_pre type="php"]if( !empty( $ar_matches[1] ) ) {
foreach( $ar_matches[1] as $ar_key => $ar_value ) {
$ar_message = str_replace( '{' . $ar_value . '}' , $submits[ $ar_value ], $ar_message );
}
}[/ch_pre]

and replace it with:
[ch_pre type="php"]if( !empty( $ar_matches[1] ) ) {
foreach( $ar_matches[1] as $ar_key => $ar_value ) {
$ar_message = str_replace( '{' . $ar_value . '}' , ( is_array($submits[ $ar_value ]) ? explode( ', ', $submits[ $ar_value ] ) : $submits[ $ar_value ] ), $ar_message );
}
}[/ch_pre]

Additionally, replace {realestate-enquiry-projects[]} with {realestate-enquiry-projects} in your code.

This should work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

NnperroMar 10, 2023

Thank you for your reply!

I tried your new code but it didn't work. It posted only the last selection.

I have only 4 days left for the support so I will leave this for this time and wait for the new version for the next time.

Thank you.

SSemicolon WebSTAFFMar 10, 2023

Hello,

Apologies, there was a mistake in the code.

Please consider using this code instead:
[ch_pre type="php"]if( !empty( $ar_matches[1] ) ) {
foreach( $ar_matches[1] as $ar_key => $ar_value ) {
$ar_message = str_replace( '{' . $ar_value . '}' , ( is_array($submits[ $ar_value ]) ? implode( ', ', $submits[ $ar_value ] ) : $submits[ $ar_value ] ), $ar_message );
}
}[/ch_pre]

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

NnperroMar 10, 2023

Thank you for your prompt reply.

It worked!

Thanks a lot for your support!!

I would appreciate if you can make a form with a checkbox for your future product.

SSemicolon WebSTAFFMar 10, 2023

Super Glad the issue was resolved! We are more than Happy to Help! :)

We will be definitely adding more Form Layouts in the Future Updates of Canvas.

Please do let us know if we can help you with anything else.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard