javascript - checkbox value within submit button -


so tough describe cannot figure out, feel close however!

basically have list of things, need organised.

lets pretend books, have these books, information on them (author, length, title, genre). if wanted search array of books comedic books. tick comedy tickbox , hit search.

i have gotten work easily! tricky part search straight away when selected, javascript searches through checkboxes see checkboxes selected before runs code eliminates answers irrelevant. needs checkbox value submitted.

is there way can have image functions button, carries value of checkbox...???

so far have gotten close:

<div class="wells">     <input type="image" value="comedy" src="img/pieces/comedy.png"            alt="comedy" onclick="myfunction()" checked> </div> 

i know myfunction works , told. literally need value of checkbox used submit button.

the long way this:

<img class="imgcomedy" src="img/pieces/comedy.png"> : <input type="checkbox" class="roundedone" name="comedy" value="comedy"> 

then user scroll submit button , hit send, sending value of checkbox function myfunction().

i know myfunction works , told. literally need value of checkbox used submit button.

you can give image behaves checkbox, when click on submit gives values true.or false check box.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -