Issue
Since the default radio button doesnt allow me to style much, I want to create a "custom" radio button and pass the selected when the submit button is clicked.
My Current code:
[http://codepen.io/vincentccw/pen/srJjo]
What it does is when user clicks on it, its background
will turn red and a value
will be stored with valueRegistered
variable.
As you can see, how do I pass the varible value together with the submit
button once clicked?
Thanks for the help in advance.
Solution
I have this solution,it might not be good in terms of performance.
What you can do is:
Add an input item in the <form>
in a hidden state like this:
<input type="button" name="testing" hidden="hidden" value="__________"/>
You can set the value
attribute of the field through Javascript
when the relative link is clicked.
For instance:
if(sam button clicked)
set `value` of `testing` = `sambutton`
else if(sam button2 clicked)
set `value` of `testing` = `sambutton2`
else if(sam button3 clicked)
set `value` of `testing` = `sambutton3`
Like this the value would be saved in the testing
field and it could be submitted when you submit the form and the users won't even see it.
Regards, Safeer
Answered By - Safeer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.