multiple choice form

10 replies · opened Oct 28, 2016

Jjohnburgess86Oct 28, 2016

Hey there,

I have created a form and everything seems to be working just fine, you get added to our email subscription, we get an email from the form submission. however if you chose more than one "application" the form doesn't work, you don't get a successful submission alert, no subscription, and no email to us.

I have tried searching the forum and have tried taking

`$application = isset($application) ? "Applications: $application

" : '';`

and making it this

$application = isset($application) ? "application: $application

" : '';
				if( is_array( $application ) && !empty( $application ) ) {
    			$application = "application: " . implode( ', ', $application ) . "

" : '';
				}

and it still wont work. what am i missing.

http://ranchworx.com/new-site3/quote.html

SSemicolon WebSTAFFNov 2, 2016

Hello,

Since the Form Input is using the Array, consider replacing name="template-quoteform-application" with name="template-quoteform-application[]". This should do the Trick.

Thanks for your Patience.

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

Jjohnburgess86Nov 2, 2016

So that seems to have worked, however I am using,

`$application = isset($application) ? "Applications: $application

" : '';`

the issue is I get back the selection of "array" in my email.

I tried the code,

$application = isset($application) ? "Applications: $application

" : '';
                if( is_array( $application ) && !empty( $application ) ) {
                $application = "application: " . implode( ', ', $application ) . "

" : '';
                }

and the email doesn't send and the form doesn't work. Is something wrong with the second code, or is there a way to get it to list the selections instead of saying array?

Jjohnburgess86Nov 2, 2016

also can you not mark this as solved, since it hasn't been?

SSemicolon WebSTAFFNov 3, 2016

Hello,

We have just checked out your Codes and there was minor issue with the Code. Please consider using the following code:

$application = isset($application) ? "Applications: $application

" : '';

if( is_array( $application ) && !empty( $application ) ) {
	$application = "Applications: " . implode( ', ', $application ) . "

";
}

This should definitely work fine. Let us know if we can help you with anything else or if you find any further issues.

Jjohnburgess86Nov 3, 2016

Even with this code I am still getting "Array" as the field, and not a list of their choices.

SSemicolon WebSTAFFNov 4, 2016

Hello,

To Troubleshoot this Error, please add the .customjs Class to the .contact-widget Element and then add the following code:

var_dump( $application );

just after the following line of code:

if( is_array( $application ) && !empty( $application ) ) {
    $application = "Applications: " . implode( ', ', $application ) . "

";
}

This will enable us to see what kind of Array we are dealing with and then help us in providing you with the accurate solution. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Jjohnburgess86Nov 4, 2016

Ok I believe I correctly added what you were asking for

Jjohnburgess86Nov 4, 2016
string(27) "Applications: Array

" { "alert": "success", "message": "We have successfully received your Message and will get Back to you as soon as possible." }

it takes me to this when i fill out my quote form

Jjohnburgess86Nov 7, 2016

have you had any luck testing this?

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