jquery mobile checkbox form data - forms

I am struggling to figure out how to pass check box info in jquery mobile for a form. In the form I have the following set of check boxs for users to select what clubs they want:
<li data-role="fieldcontain">
<fieldset data-role="controlgroup" data-type="horizontal">
<legend>Select Set?</legend>
<option value=""></option>
<input type="checkbox" name="t123_irons" id="t123_irons" class="custom" value="3">
<label for="t123_irons">3</label>
<input type="checkbox" name="t124_irons" id="t124_irons" class="custom" value="4">
<label for="t124_irons">4</label>
<input type="checkbox" name="t125_irons" id="t125_irons" class="custom" value="5">
<label for="t125_irons">5</label>
<input type="checkbox" name="t126_irons" id="t126_irons" class="custom" value="6">
<label for="t126_irons">6</label>
<input type="checkbox" name="t127_irons" id="t127_irons" class="custom" value="7">
<label for="t127_irons">7</label>
<input type="checkbox" name="t128_irons" id="t128_irons" class="custom" value="8">
<label for="t128_irons">8</label>
<input type="checkbox" name="t129_irons" id="t129_irons" class="custom" value="9">
<label for="t129_irons">9</label>
<input type="checkbox" name="t12pw_irons" id="t12pw_irons" class="custom" value="PW">
<label for="t12pw_irons">PW</label>
</fieldset>
</li>
I am not sure what to put on my review form to get the checkboxs that are selected since in jQuery mobile the check box group all have different IDs and Names for checkbox groups.This is how I imagine I would get the group if they had one unified name/id:
echo (!empty($_REQUEST['t12_irons'])) ? "<div class='reviewItem'><span class='reviewTitle'>In Set:</span>{$_REQUEST['t12_irons']}</div>" : "";

Related

How do I get checkbox value in email after submit from https://formsubmit.co?

Hi I use https://formsubmit.co as form submit.
Formsubmit only returns one checkbox even if two or more checkboxes is checked.
<form action="https://formsubmit.co/info#enchuga.com" method="POST">
<input type="hidden" name="_subject" value="Snyggt!! Ny beställning av algos">
<input type="hidden" name="_next" value="https://enchuga.com/enchugacap/thanks.html">
Name: <br>
<input class="contactForm" type="text" name="Name" placeholder="Your name" required> <br>
<br>
Mail: <br>
<input class="contactForm" type="email" name="Email" placeholder="Email Address" required> <br>
<br>
Which trading algorithms do you want to order? <br>
<input type="checkbox" id="LosAngeles" name="Algo" value="LosAngeles">
<label for="LosAngeles" class="orderText"> Los Angeles 69€/year (699 SEK)</label><br>
<input type="checkbox" id="London" name="Algo" value="London">
<label for="London" class="orderText"> London 69€/year (699 SEK)</label><br>
<input type="checkbox" id="Paris" name="Algo" value="Paris">
<label for="Paris" class="orderText"> Paris 69€/year (699 SEK)</label><br>
<input type="checkbox" id="Berlin" name="Algo" value="Berlin">
<label for="Berlin" class="orderText"> Berlin 69€/year (699 SEK)</label><br>
<input type="checkbox" id="NewYork" name="Algo" value="NewYork">
<label for="NewYork" class="orderText"> New York 69€/year (699 SEK)</label><br>
<input type="checkbox" id="allAlgos" name="Algo" value="allAlgos">
<label for="allAlgos" class="orderText"> All five algos 260€/year (2600 SEK, 25% discount)</label><br>
<br>
Send a message to enchuga CAPITAL if you wondering about anything or want to ask a question: <br>
<input class="contactForm2" type="text" name="Message"> <br>
<br>
<button type="submit">Send</button>
</form>
How do I get it to return every checkbox checked?
I have tried to create checkboxes that returns the item they checked but I don't get it to work.

Validating inline radio buttons in Bootstrap 5.1

I have a form that requires validation and works fine for text and textareas but not for inline radio buttons.
<form class="needs-validation" novalidate method="POST">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1" required>
<label class="form-check-label" for="inlineRadio1">1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2" required>
<label class="form-check-label" for="inlineRadio2">2</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio3" value="option3" required>
<label class="form-check-label" for="inlineRadio3">3</label>
</div>
<div class="invalid-feedback">
Radio button is required.
</div>
<button class="btn btn-primary" type="submit">Validate</button>
</form>
I see that the controls and labels turn red when submitted but the text in the invalid-feedback is not there. I also want it to be aligned all the way to the left.

Angular 4 - Checking one checkbox checks them all

Not sure how to fix this. I want to have an array of strings based on a checkbox form. I have all the values set to be added to the same array (MenteeLevelPrefernce), but when I check one box they all get checked. What am I doing wrong here?
<label for="mentorPrefCheck">Mentee Level Preference (select all that apply)</label>
<div class="form-group" id="mentorPrefCheck">
<label class="checkbox-inline">
<input type="checkbox" id="hsLevelCheck" [(ngModel)]="mentor.MenteeLevelPreference" name="menteeLevelPreference" value="Highscool"> Highschool</label>
<label class="checkbox-inline">
<input type="checkbox" id="undergradLevelCheck" [(ngModel)]="mentor.MenteeLevelPreference" name="menteeLevelPreference" value="Undergraduate"> Undergraduate</label>
<label class="checkbox-inline">
<input type="checkbox" id="gradLevelCheck" [(ngModel)]="mentor.MenteeLevelPreference" name="menteeLevelPreference" value="Graduate"> Graduate</label>
</div>
use unique variables for [(ngModel)] and name attributes
<div class="form-group" id="mentorPrefCheck">
<label class="checkbox-inline">
<input type="checkbox" id="hsLevelCheck" [(ngModel)]="mentor.MenteeLevelPreference1" name="menteeLevelPreference1" value="Highscool"> Highschool</label>
<label class="checkbox-inline">
<input type="checkbox" id="undergradLevelCheck" [(ngModel)]="mentor.MenteeLevelPreference2" name="menteeLevelPreference2" value="Undergraduate"> Undergraduate</label>
<label class="checkbox-inline">
<input type="checkbox" id="gradLevelCheck" [(ngModel)]="mentor.MenteeLevelPreference3" name="menteeLevelPreference3" value="Graduate"> Graduate</label>
</div>

Bootstrap form spans not even

I have created a form and would like to ensure that all the spans line up and are square. But even though all the spans will add up to 12, each row is a different width. Is just the way it is, or am I doing something wrong?
<div class="container ">
<form class="well form-inline">
<div class="controls controls-row">
<label class="span1" for="input01">
Prefix
</label>
<input type="text" class="span1" id="input01" placeholder="Dr."><label class="span1" for="input02">
First Name
</label>
<input type="text" class="span3" id="input02" placeholder="John">
<label class="control-label span1" for="input03">
last Name
</label>
<input type="text" class="span3" id="input03" placeholder="Doe">
<label class="control-label span1" for="input04">
Suff
</label>
<input type="text" class="span1" id="input04" placeholder="Jr.">
</div>
<div class="controls controls-row">
<label class="span1" for="input01">
Company
</label>
<input type="text" class="span5" id="input01" placeholder="Sample LLC">
<label class="span1" for="input02">
Title
</label>
<input type="text" class="span5" id="input02" placeholder="Director of Samples">
</div>
<div class="controls controls-row">
<label class="span1" for="input01">
Address 1
</label>
<input type="text" class="span5" id="input01" placeholder="Address Line 1">
<label class="span1" for="input02">
Address 2
</label>
<input type="text" class="span5" id="input02" placeholder="Address Line 2">
</div>
<div class="controls controls-row">
<label class="span1" for="input01">
Cntry
</label>
<select class="input-medium span2 countries" data-country="US"></select>
<label class="span1" for="input01">
City
</label>
<input type="text" class="span2" id="input02" placeholder="City">
<label class="span1" for="input02">
St/Prv
</label>
<select class="input-medium span2 states" data-country="US" data-state="CA"></select>
<label class="span1" for="input01">
Zip
</label>
<input type="text" class="span2" id="input02" placeholder="City">
</div>
<div class="controls controls-row">
<label class="span1" for="input01">
Email
</label>
<input type="text" class="span5" id="input01" placeholder="you#yourdomain.com">
<label class="span2" for="input02">
Confirm Email
</label>
<input type="text" class="span4" id="input02" placeholder="you#yourdomain.com">
</div>
<div class="controls controls-row">
<label class="span1" for="input01">
Phone
</label>
<input type="text" class="span3" id="input01" placeholder="">
<label class="span1" for="input02">
Cell
</label>
<input type="text" class="span3" id="input02" placeholder="">
<label class="span1" for="input02">
Fax
</label>
<input type="text" class="span3" id="input02" placeholder="">
</div>
</form>
</div>
screen shot here: http://www.flickr.com/photos/92503149#N07/8409032538/in/photostream
You only posted a snippet, so I do not know how you integrat the form in the rest of your page, but a row-fluid could help:
<form class="well form-inline row-fluid">
I tried it out, looks much nicer already.
More hints:
some labels are missing the class control-label. This is overall important due to the line-height adjustment that control-label does.
depending on the complete width of the form, some labels might not fit into span1 on one line (was the case in my quick tests)
and a general design hint: the last line with 3 label/input pairs breaks the layouting a bit. Usually, you try to stick to certain vertical positioning.
Hope this helps

Zend_Form_Element_Checkbox issue

I want to achieve the example html markup using Zend_Form_Element_Checkbox. Encounter problems, however, for example page_actions[]. I want to have this in a attribute and receive array in request. I know I must do it in the init of the form, but I lack knowledge of Zend Framework. I tried several options. For example, this:
// In for loop in init method
$element = new Zend_Form_Element_Checkbox('test['.$i.']');
$element->setIsArray(true)->setBelongsTo('checkbox_name');
$this->addElement($element);
This is the markup I would like to achieve:-
<div>
<div>
Some bold message for this group
</div>
<div>
<span>
<input type="checkbox" id="qf_18" value="12" name="page_actions[]"/><label for="qf_18">Test 18</label><br/>
<input type="checkbox" id="qf_20" value="13" name="page_actions[]"/><label for="qf_20">Test 20</label><br/>
<input type="checkbox" id="qf_22" value="14" name="page_actions[]"/><label for="qf_22">Test 22</label><br/>
<input type="checkbox" id="qf_24" value="15" name="page_actions[]"/><label for="qf_24">Test 24</label><br/>
<input type="checkbox" id="qf_26" value="16" name="page_actions[]"/><label for="qf_26">Test 26</label>
</span>
</div>
</div>
<div>
<div style="font-weight: bold;">
Some bold message for this other group
</div>
<div>
<span>
<input type="checkbox" id="qf_28" value="17" name="page_actions[]"/><label for="qf_28">Test 28</label><br/>
<input type="checkbox" id="qf_30" value="18" name="page_actions[]"/><label for="qf_30">Test 30</label><br/>
<input type="checkbox" id="qf_32" value="19" name="page_actions[]"/><label for="qf_32">Test 32</label><br/>
<input type="checkbox" id="qf_34" value="20" name="page_actions[]"/><label for="qf_34">Test 34</label><br/>
<input type="checkbox" id="qf_36" value="21" name="page_actions[]"/><label for="qf_36">Test 35</label>
</span>
</div>
</div>
You can use view script to do that. I think zend form decorator is not support to this kind of form.