set selectbox options as a checkbox choices









up vote
-2
down vote

favorite












I have select box in my form, I dont know how many values this select box will filled out because it get it's values from DB.
2-After this selectbox filled out, I need to take all it's values and set it as checkbox choices.
3- User will chose some of this checkbox choices or check all of them.
4- need to take that choices what user will check and concatenate in text box Separated by dash "-" and if user not check any of them keep textbox empty.






<select id= "selectbox">
<option value="option1">Choice1</option>
<option value="option2">Choice2</option>
<option value="option3">Choice3</option>
</select>


<input type="checkbox" id="chckbox">
<label for="Field3-0">Checkbox1</label>
<input type="checkbox" id="chckbox">
<label for="Field3-1">Checkbox2</label>

<input id= "textfield" type= "text" >












share|improve this question

















  • 1




    You haven't really asked any questions here. All you've done is stated your requirements. We expect that you will do your research ahead of time and make an attempt at a solution. Then, if you have a specific question about your attempt. Post that here.
    – Scott Marcus
    Nov 10 at 19:33










  • And please don't duplicate questions. You already asked the same question here stackoverflow.com/questions/53241593/…
    – charlietfl
    Nov 10 at 19:44










  • sorry for that, I tried to ask question step by step to be clear. I already try to search for solution for that requirements , First i get values for selectbox then try to set for checkbox but it not working $(document).ready(function() var options = $('#selectbox option').text(); $("#checkbox").text(options); );
    – M.Gooda
    Nov 10 at 19:58











  • Check How to add value of checked checkbox to textarea using jquery?
    – Mohammad
    Nov 10 at 20:23














up vote
-2
down vote

favorite












I have select box in my form, I dont know how many values this select box will filled out because it get it's values from DB.
2-After this selectbox filled out, I need to take all it's values and set it as checkbox choices.
3- User will chose some of this checkbox choices or check all of them.
4- need to take that choices what user will check and concatenate in text box Separated by dash "-" and if user not check any of them keep textbox empty.






<select id= "selectbox">
<option value="option1">Choice1</option>
<option value="option2">Choice2</option>
<option value="option3">Choice3</option>
</select>


<input type="checkbox" id="chckbox">
<label for="Field3-0">Checkbox1</label>
<input type="checkbox" id="chckbox">
<label for="Field3-1">Checkbox2</label>

<input id= "textfield" type= "text" >












share|improve this question

















  • 1




    You haven't really asked any questions here. All you've done is stated your requirements. We expect that you will do your research ahead of time and make an attempt at a solution. Then, if you have a specific question about your attempt. Post that here.
    – Scott Marcus
    Nov 10 at 19:33










  • And please don't duplicate questions. You already asked the same question here stackoverflow.com/questions/53241593/…
    – charlietfl
    Nov 10 at 19:44










  • sorry for that, I tried to ask question step by step to be clear. I already try to search for solution for that requirements , First i get values for selectbox then try to set for checkbox but it not working $(document).ready(function() var options = $('#selectbox option').text(); $("#checkbox").text(options); );
    – M.Gooda
    Nov 10 at 19:58











  • Check How to add value of checked checkbox to textarea using jquery?
    – Mohammad
    Nov 10 at 20:23












up vote
-2
down vote

favorite









up vote
-2
down vote

favorite











I have select box in my form, I dont know how many values this select box will filled out because it get it's values from DB.
2-After this selectbox filled out, I need to take all it's values and set it as checkbox choices.
3- User will chose some of this checkbox choices or check all of them.
4- need to take that choices what user will check and concatenate in text box Separated by dash "-" and if user not check any of them keep textbox empty.






<select id= "selectbox">
<option value="option1">Choice1</option>
<option value="option2">Choice2</option>
<option value="option3">Choice3</option>
</select>


<input type="checkbox" id="chckbox">
<label for="Field3-0">Checkbox1</label>
<input type="checkbox" id="chckbox">
<label for="Field3-1">Checkbox2</label>

<input id= "textfield" type= "text" >












share|improve this question













I have select box in my form, I dont know how many values this select box will filled out because it get it's values from DB.
2-After this selectbox filled out, I need to take all it's values and set it as checkbox choices.
3- User will chose some of this checkbox choices or check all of them.
4- need to take that choices what user will check and concatenate in text box Separated by dash "-" and if user not check any of them keep textbox empty.






<select id= "selectbox">
<option value="option1">Choice1</option>
<option value="option2">Choice2</option>
<option value="option3">Choice3</option>
</select>


<input type="checkbox" id="chckbox">
<label for="Field3-0">Checkbox1</label>
<input type="checkbox" id="chckbox">
<label for="Field3-1">Checkbox2</label>

<input id= "textfield" type= "text" >








<select id= "selectbox">
<option value="option1">Choice1</option>
<option value="option2">Choice2</option>
<option value="option3">Choice3</option>
</select>


<input type="checkbox" id="chckbox">
<label for="Field3-0">Checkbox1</label>
<input type="checkbox" id="chckbox">
<label for="Field3-1">Checkbox2</label>

<input id= "textfield" type= "text" >





<select id= "selectbox">
<option value="option1">Choice1</option>
<option value="option2">Choice2</option>
<option value="option3">Choice3</option>
</select>


<input type="checkbox" id="chckbox">
<label for="Field3-0">Checkbox1</label>
<input type="checkbox" id="chckbox">
<label for="Field3-1">Checkbox2</label>

<input id= "textfield" type= "text" >






javascript jquery






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 19:23









M.Gooda

5117




5117







  • 1




    You haven't really asked any questions here. All you've done is stated your requirements. We expect that you will do your research ahead of time and make an attempt at a solution. Then, if you have a specific question about your attempt. Post that here.
    – Scott Marcus
    Nov 10 at 19:33










  • And please don't duplicate questions. You already asked the same question here stackoverflow.com/questions/53241593/…
    – charlietfl
    Nov 10 at 19:44










  • sorry for that, I tried to ask question step by step to be clear. I already try to search for solution for that requirements , First i get values for selectbox then try to set for checkbox but it not working $(document).ready(function() var options = $('#selectbox option').text(); $("#checkbox").text(options); );
    – M.Gooda
    Nov 10 at 19:58











  • Check How to add value of checked checkbox to textarea using jquery?
    – Mohammad
    Nov 10 at 20:23












  • 1




    You haven't really asked any questions here. All you've done is stated your requirements. We expect that you will do your research ahead of time and make an attempt at a solution. Then, if you have a specific question about your attempt. Post that here.
    – Scott Marcus
    Nov 10 at 19:33










  • And please don't duplicate questions. You already asked the same question here stackoverflow.com/questions/53241593/…
    – charlietfl
    Nov 10 at 19:44










  • sorry for that, I tried to ask question step by step to be clear. I already try to search for solution for that requirements , First i get values for selectbox then try to set for checkbox but it not working $(document).ready(function() var options = $('#selectbox option').text(); $("#checkbox").text(options); );
    – M.Gooda
    Nov 10 at 19:58











  • Check How to add value of checked checkbox to textarea using jquery?
    – Mohammad
    Nov 10 at 20:23







1




1




You haven't really asked any questions here. All you've done is stated your requirements. We expect that you will do your research ahead of time and make an attempt at a solution. Then, if you have a specific question about your attempt. Post that here.
– Scott Marcus
Nov 10 at 19:33




You haven't really asked any questions here. All you've done is stated your requirements. We expect that you will do your research ahead of time and make an attempt at a solution. Then, if you have a specific question about your attempt. Post that here.
– Scott Marcus
Nov 10 at 19:33












And please don't duplicate questions. You already asked the same question here stackoverflow.com/questions/53241593/…
– charlietfl
Nov 10 at 19:44




And please don't duplicate questions. You already asked the same question here stackoverflow.com/questions/53241593/…
– charlietfl
Nov 10 at 19:44












sorry for that, I tried to ask question step by step to be clear. I already try to search for solution for that requirements , First i get values for selectbox then try to set for checkbox but it not working $(document).ready(function() var options = $('#selectbox option').text(); $("#checkbox").text(options); );
– M.Gooda
Nov 10 at 19:58





sorry for that, I tried to ask question step by step to be clear. I already try to search for solution for that requirements , First i get values for selectbox then try to set for checkbox but it not working $(document).ready(function() var options = $('#selectbox option').text(); $("#checkbox").text(options); );
– M.Gooda
Nov 10 at 19:58













Check How to add value of checked checkbox to textarea using jquery?
– Mohammad
Nov 10 at 20:23




Check How to add value of checked checkbox to textarea using jquery?
– Mohammad
Nov 10 at 20:23

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242606%2fset-selectbox-options-as-a-checkbox-choices%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242606%2fset-selectbox-options-as-a-checkbox-choices%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線