javascript - HTML onmousedown/onclick display hidden HTML -


i'm making form order different varieties of sweets website. @ moment have checkboxes each variety. once have chosen varieties want (they can have more one) need more information. want display new box when check each checkbox. event attributes seem adequate, don't know javascript, right way me it? can event attributes trigger javascript?

or perhaps i'm going wrong way, there better way make form? i've considered shopping cart want think it's much, , i'm not advanced.

so, want way show html after checkbox has been ticked, or better way make form.

thanks

if have skills server-side programming (php, asp, asp.net, jsp), may way go. when checkbox changes, redraw options using ajax of flavor (e.g. asp.net updatepanel). avoid doing javascript on client, though it's doable way.

if aren't strong on either client or server-side programming, third-party shopping cart way go. start investigation paypal.

important: if write own order form, make sure not storing credit card numbers @ point in process. avoid having credit card numbers submitted site if @ possible. become familiar pci compliance. alone justification using third-party tool.

edit: per paul's comment below wants keep simple possible , no transactions handled:

"can event attributes trigger javascript?"

yes, either inline javascript or script contained in external file, or elsewhere on page in script tags.

here's little sample of 1 checkbox triggering other html elements (in case, other checkboxes): http://www.htmlcodetutorial.com/forms/_input_onclick.html

you can show or hide element using code this:

var elementtotoggle = document.getelementbyid('someid'); elementtotoggle.style.display = "none"; // hide  or  elementtotoggle.style.display = ""; 

using jquery (www.jquery.com) library potentially make simpler, there initial learning curve.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -