मैं चेकबॉक्स समूह 'locationthemes' के माध्यम से लूप करना चाहता हूं और सभी चयनित मानों के साथ एक स्ट्रिंग बनाना चाहता हूं। तो जब चेकबॉक्स 2 और 4 का चयन किया जाता परिणाम होगा: "3,8"चयनित चेकबॉक्स के मान प्राप्त करने के लिए jQuery का उपयोग करें
<input type="checkbox" name="locationthemes" id="checkbox-1" value="2" class="custom" />
<label for="checkbox-1">Castle</label>
<input type="checkbox" name="locationthemes" id="checkbox-2" value="3" class="custom" />
<label for="checkbox-2">Barn</label>
<input type="checkbox" name="locationthemes" id="checkbox-3" value="5" class="custom" />
<label for="checkbox-3">Restaurant</label>
<input type="checkbox" name="locationthemes" id="checkbox-4" value="8" class="custom" />
<label for="checkbox-4">Bar</label>
मैं यहाँ जाँच: http://api.jquery.com/checked-selector/ लेकिन कोई उदाहरण को उसके नाम से checkboxgroup चयन करने के लिए कैसे।
मैं यह कैसे कर सकता हूं?
आप, मेरे दोस्त, एक जीवन बचतकर्ता हैं। – Haring10
विशेष रूप से मुझे कंसोल-लॉग का उपयोग करके विचार पसंद है। उसके लिए धन्यवाद। –