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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

adding radio buttons to add to cart button form

Thread began 4/24/2015 12:00 pm by marsha431457 | Last modified 4/29/2015 2:44 pm by marsha431457 | 1210 views | 14 replies

Ray BorduinWebAssist

Yes you will have to remove the validation on those fields (or add an IF statement in the code to only validate when the appropriate radio is selected).

But before getting to that, you still aren't calling the javascript code that I gave you... you need to add the onclick even to both radio buttons like:

<input type="radio" onclick="enableDisableFields()" ...

without that the code I gave you isn't even running. I tested it and I also found a problem with the code. Try using this instead:

<script>
function enableDisableFields() {
if (document.getElementById("side1_0").checked) {
document.getElementById("boh_2_Inscription1_Add").removeAttribute('disabled');
document.getElementById("boh_2_Inscription2_Add").removeAttribute('disabled');
document.getElementById("boh_2_Inscription3_Add").removeAttribute('disabled');
document.getElementById("boh_2_Logo_Add").setAttribute('disabled','true');
document.getElementById("boh_2_Logo_Add").selectedIndex = 0;
} else {
document.getElementById("boh_2_Inscription1_Add").setAttribute('disabled','true');
document.getElementById("boh_2_Inscription2_Add").setAttribute('disabled','true');
document.getElementById("boh_2_Inscription3_Add").setAttribute('disabled','true');
document.getElementById("boh_2_Inscription1_Add").value = "";
document.getElementById("boh_2_Inscription2_Add").value = "";
document.getElementById("boh_2_Inscription3_Add").value = "";
document.getElementById("boh_2_Logo_Add").removeAttribute('disabled');
}
}
</script>



Once you get that working, you can send me a copy of the page and I'll show you how to make the validation conditional based on the radio selected.

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...