close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

radio buttons

Thread began 4/23/2010 3:07 pm by scanlan27458 | Last modified 6/18/2010 3:21 pm by Jason Byrnes | 1854 views | 17 replies |

scanlan27458

radio buttons

I have customized a form and added radio buttons.
When the radio buttons are filled in, yes or no,
and the submit button is clicked and the form doesn't send,
the filled in radio button results disappear.
If a person sends again, the radio button value gets lost.
Is there a way to get the radio buttons to stay filled in like the textfields do?
Url of the form is:
contactus.php
Thanks,
I've been staring at this for hours

Sign in to reply to this post

Jason ByrnesWebAssist

your radio buttons don't have a checked value.


for a radio button to be able to maintain state, it must have a checked value, this is the value that will be sent if it is checked.


In design view, select the radio button.

In the property inspector, enter a checked value.

Now click the Dynamic Button. Click the lightning bolt next to select value equal to and select the radio button from the data binding list.

Sign in to reply to this post

scanlan27458

checkboxes

Thanks for the info about radio buttons, that worked.
I have finished this rather long and complicatd form and have set up several groups of checkboxes.
The checkboxes are not sending correctly, only one selections sends at a time, and we want all selections to send at once.

Same form:
contactusNew.php

Please advise,

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

to send multiple values with check boxes, you need to make sure the name of the check box ends in "[]"


fro example:<input type="checkbox" name="Services[]" value="Drop-In Visits" id="Services_1" />

this creates an array to hold all of the cehcked values, to output the array in the email, you will need to use the implode function:


<?php echo((isset($_POST["Services"]))?implode(", ", $_POST["Services"]):"") ?>

Sign in to reply to this post

scanlan27458

<input type="checkbox" name="Services[]" value="Neighborhood Walks" id="Services_0" /><?php echo((isset($_POST["Services"]))?implode(", ", $_POST["Services"]):"") ?>
Neighborhood Walks</label>
<br /><label>
<input type="checkbox" name="Services[]" value="Drop-In Visits" id="Services_1" /><?php echo((isset($_POST["Services"]))?implode(", ", $_POST["Services"]):"") ?>
Drop-In Visits</label>

I have the above and I am getting this in the email: Services: Array

What am I doing wrong. Appreciate your feedback.
Thanks,
Gail

Sign in to reply to this post

Jason ByrnesWebAssist

in the email massage, you need to alter the code that outputs the form element:

php:
<?php echo((isset($_POST["Services"]))?$_POST["Services"]:""?>




to use the implode function to convert the array to a comma seperated listed:

php:
<?php echo((isset($_POST["Services"]))?implode(", "$_POST["Services"]):""?>
Sign in to reply to this post

scanlan27458

checkbox array

Sorry Jason, I am completely confused.
Here are three checkboxes in an array. Do you add code to these three separate elements of the array?
And then code in the head section of the html form?
Which code goes where?

<label>
<input type="checkbox" name="Services[]" value="Neighborhood Walks" id="Services_0" />
Neighborhood Walks</label>
<br /><label>
<input type="checkbox" name="Services[]" value="Drop-In Visits" id="Services_1" />
Drop-In Visits</label>
<br /><label>
<input type="checkbox" name="Services[]" value="Trail or Off-leash Walks" id="Services_2" />
Trail or Off-leash Walks</label>

Thanks in advance for your help, Gail

Sign in to reply to this post

Jason ByrnesWebAssist

the only modification that needs to happen to the form is adding "[]" to the name of the element to create the array.

In universal email, you need to modify the email message.



to get the value of the form element into the email, it will use the following code:

php:
<?php echo((isset($_POST["Services"]))?$_POST["Services"]:""?>




this code in the email message needs to be modified to convert the array to a string using implode function:

php:
<?php echo((isset($_POST["Services"]))?implode(", "$_POST["Services"]):""?>
Sign in to reply to this post

scanlan27458

I don't see that code in universal email so I can't replace it.
Please advise, the form still is not sending the checkbox array.
the form is at the following url:
contactusNew.php

Sign in to reply to this post

Jason ByrnesWebAssist

please send a copy of your page and the webassist directory and I will help you find the code that needs to be replaced.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...