how to add dynamic class name in thymeleaf in select option? - class

i submit with model to template
in template
i used th:each and in th:each i used select option
i want to dynamically add select's class name
"${cos_seq}" is int so i add 'abc'
<th:each="row:${Basket}">
<select class="'abc'+'${row.cos_seq}'"
th:value="${row.cos_seq}" style="float:left;margin-
right:5px ;width:45px;height:42px;" >
<option
class="qty-option" value="1" text="1"
style="width:20px">1</option>
<option
class="qty-option" value="2" text="2"
style="width:20px">2</option>
<option
class="qty-option" value="3" text="3"
style="width:20px">3</option>
<option
class="qty-option" value="4" text="4"
style="width:20px">4</option>
<option
class="qty-option" value="5" text="5"
style="width:20px">5</option>
<option
class="qty-option" value="6" text="6"
style="width:20px">6</option>
<option
class="qty-option" value="7" text="7"
style="width:20px">7</option>
<option
class="qty-option" value="8" text="8"
style="width:20px">8</option>
<option
class="qty-option" value="9" text="9"
style="width:20px">9</option>
<option
class="qty-option" value="10+" text="10+"
style="width:20px">10+</option>
</select>

Related

Execute Intelij IDEA code format when committing

I would like to apply a code format action before I'm commiting.
Currently I have xml eclipse file that would define the format I would apply.
Since I have gradle and spotless I declared an action such as:
spotless {
enforceCheck false
java {
licenseHeaderFile "${rootDir}/LICENSE"
// licenseHeaderFile "${rootDir}/LICENSE"
eclipse().configFile("eclipse/formater.xml")
}
}
That is triggered by a shell script that is a git hook:
#!/bin/bash
set -e
toFormat="$(git --no-pager diff --name-status --cached | awk '$1 != "D" && $2 ~ /\.kts|\.java|\.kt/ { print $NF}')"
echo "Will format the files:"
echo $toFormat | tr " " "\n"
for fileToFormatPath in $eligibleToFormat
do
./gradlew spotlessApply -PspotlessIdeHook="$(pwd)/$fileToFormatPath"
git add $fileToFormatPath
done;
And so far it is working.
Now I would like to do it but directly using the declared IDEA xml formater such as:
<code_scheme name="formater" version="173">
<JavaCodeStyleSettings>
<option name="ANNOTATION_PARAMETER_WRAP" value="1" />
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="RIGHT_MARGIN" value="120" />
<option name="KEEP_LINE_BREAKS" value="false" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="true" />
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="2" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="2" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="2" />
<option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACES" value="true" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="5=4" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="RESOURCE_LIST_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
<option name="SMART_TABS" value="true" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
I don't find much idea on the internet, any suggestion ?

Where does a customer enter coupon code 2checkout?

I want to add coupons on my live site but before I do that I am testing the coupons on my sandbox. I have created coupons in the 2checkout admin area. According to the documentation, a customer enters the coupon code after being redirected to the 2checkout site. However, I only see the pop up but i don't see any area to enter coupon code.What gives?
<form class="form-horizontal form" action="<?php echo $action;?>" method="post">
<div class="panel panel-primary">
<div class="panel-heading"><strong>BILLING INFORMATION</strong></div>
<div class="panel-body">
<div class="form-group required">
<label class="col-md-2">Country</label>
<div class="col-md-10">
<select id="country" class="form-control" name="country" autocomplete="on" required="">
<option value="" class="ng-binding">- Choose Country -</option>
<option value="USA">United States</option>
<option value="GBR">United Kingdom</option>
<option value="CAN">Canada</option>
<option value="AUS">Australia</option>
<option disabled="" value="—">—</option>
<option value="ALA">Åland Islands</option>
<option value="AFG">Afghanistan</option>
<option value="ALB">Albania</option>
<option value="DZA">Algeria</option>
<option value="ASM">American Samoa</option>
<option value="AND">Andorra</option>
<option value="AGO">Angola</option>
<option value="AIA">Anguilla</option>
<option value="ATA">Antarctica</option>
<option value="ATG">Antigua and Barbuda</option>
<option value="ARG">Argentina</option>
<option value="ARM">Armenia</option>
<option value="ABW">Aruba</option>
<option value="AUS">Australia</option>
<option value="AUT">Austria</option>
<option value="AZE">Azerbaijan</option>
<option value="BHS">Bahamas</option>
<option value="BHR">Bahrain</option>
<option value="BGD">Bangladesh</option>
<option value="BRB">Barbados</option>
<option value="BLR">Belarus</option>
<option value="BEL">Belgium</option>
<option value="BLZ">Belize</option>
<option value="BEN">Benin</option>
<option value="BMU">Bermuda</option>
<option value="BTN">Bhutan</option>
<option value="BOL">Bolivia</option>
<option value="BES">Bonaire, Sint Eustatius and Saba</option>
<option value="BIH">Bosnia and Herzegovina</option>
<option value="BWA">Botswana</option>
<option value="BVT">Bouvet Island</option>
<option value="BRA">Brazil</option>
<option value="IOT">British Indian Ocean Territory</option>
<option value="BRN">Brunei Darussalam</option>
<option value="BGR">Bulgaria</option>
<option value="BFA">Burkina Faso</option>
<option value="BDI">Burundi</option>
<option value="KHM">Cambodia</option>
<option value="CMR">Cameroon</option>
<option value="CAN">Canada</option>
<option value="CPV">Cape Verde</option>
<option value="CYM">Cayman Islands</option>
<option value="CAF">Central African Republic</option>
<option value="TCD">Chad</option>
<option value="CHL">Chile</option>
<option value="CHN">China</option>
<option value="CXR">Christmas Island</option>
<option value="CCK">Cocos (Keeling) Islands</option>
<option value="COL">Colombia</option>
<option value="COM">Comoros</option>
<option value="COG">Congo</option>
<option value="COD">Congo, the Democratic Republic of the</option>
<option value="COK">Cook Islands</option>
<option value="CRI">Costa Rica</option>
<option value="CIV">Cote D'ivoire</option>
<option value="HRV">Croatia (Hrvatska)</option>
<option value="CYP">Cyprus</option>
<option value="CZE">Czech Republic</option>
<option value="DNK">Denmark</option>
<option value="DJI">Djibouti</option>
<option value="DMA">Dominica</option>
<option value="DOM">Dominican Republic</option>
<option value="ECU">Ecuador</option>
<option value="EGY">Egypt</option>
<option value="SLV">El Salvador</option>
<option value="GNQ">Equatorial Guinea</option>
<option value="ERI">Eritrea</option>
<option value="EST">Estonia</option>
<option value="ETH">Ethiopia</option>
<option value="FLK">Falkland Islands (Malvinas)</option>
<option value="FRO">Faroe Islands</option>
<option value="FJI">Fiji</option>
<option value="FIN">Finland</option>
<option value="FRA">France</option>
<option value="FXX">France, Metropolitan</option>
<option value="GUF">French Guiana</option>
<option value="PYF">French Polynesia</option>
<option value="ATF">French Southern Territories</option>
<option value="GAB">Gabon</option>
<option value="GMB">Gambia</option>
<option value="GEO">Georgia</option>
<option value="DEU">Germany</option>
<option value="GHA">Ghana</option>
<option value="GIB">Gibraltar</option>
<option value="GRC">Greece</option>
<option value="GRL">Greenland</option>
<option value="GRD">Grenada</option>
<option value="GLP">Guadeloupe</option>
<option value="GUM">Guam</option>
<option value="GTM">Guatemala</option>
<option value="GGY">Guernsey</option>
<option value="GIN">Guinea</option>
<option value="GNB">Guinea-Bissau</option>
<option value="GUY">Guyana</option>
<option value="HTI">Haiti</option>
<option value="HMD">Heard Island and Mcdonald Islands</option>
<option value="HND">Honduras</option>
<option value="HKG">Hong Kong</option>
<option value="HUN">Hungary</option>
<option value="ISL">Iceland</option>
<option value="IND">India</option>
<option value="IDN">Indonesia</option>
<option value="IRQ">Iraq</option>
<option value="IRL">Ireland</option>
<option value="IMN">Isle of Man</option>
<option value="ISR">Israel</option>
<option value="ITA">Italy</option>
<option value="JAM">Jamaica</option>
<option value="JPN">Japan</option>
<option value="JEY">Jersey</option>
<option value="JOR">Jordan</option>
<option value="KAZ">Kazakhstan</option>
<option value="KEN">Kenya</option>
<option value="KIR">Kiribati</option>
<option value="KOR">Korea, Republic of</option>
<option value="UNK">UNK</option>
<option value="KWT">Kuwait</option>
<option value="KGZ">Kyrgyzstan</option>
<option value="LAO">Lao People's Democratic Republic</option>
<option value="LVA">Latvia</option>
<option value="LBN">Lebanon</option>
<option value="LSO">Lesotho</option>
<option value="LBR">Liberia</option>
<option value="LBY">Libyan Arab Jamahiriya</option>
<option value="LIE">Liechtenstein</option>
<option value="LTU">Lithuania</option>
<option value="LUX">Luxembourg</option>
<option value="MAC">Macao</option>
<option value="MKD">Macedonia</option>
<option value="MDG">Madagascar</option>
<option value="MWI">Malawi</option>
<option value="MYS">Malaysia</option>
<option value="MDV">Maldives</option>
<option value="MLI">Mali</option>
<option value="MLT">Malta</option>
<option value="MHL">Marshall Islands</option>
<option value="MTQ">Martinique</option>
<option value="MRT">Mauritania</option>
<option value="MUS">Mauritius</option>
<option value="MYT">Mayotte</option>
<option value="MEX">Mexico</option>
<option value="FSM">Micronesia, Federated States of</option>
<option value="MDA">Moldova, Republic of</option>
<option value="MCO">Monaco</option>
<option value="MNG">Mongolia</option>
<option value="MNE">Montenegro</option>
<option value="MSR">Montserrat</option>
<option value="MAR">Morocco</option>
<option value="MOZ">Mozambique</option>
<option value="MMR">Myanmar</option>
<option value="NAM">Namibia</option>
<option value="NRU">Nauru</option>
<option value="NPL">Nepal</option>
<option value="NLD">Netherlands</option>
<option value="ANT">Netherlands Antilles</option>
<option value="NCL">New Caledonia</option>
<option value="NZL">New Zealand</option>
<option value="NIC">Nicaragua</option>
<option value="NER">Niger</option>
<option value="NGA">Nigeria</option>
<option value="NIU">Niue</option>
<option value="NFK">Norfolk Island</option>
<option value="MNP">Northern Mariana Islands</option>
<option value="NOR">Norway</option>
<option value="OMN">Oman</option>
<option value="PAK">Pakistan</option>
<option value="PLW">Palau</option>
<option value="PSE">Palestinian Territory, Occupied</option>
<option value="PAN">Panama</option>
<option value="PNG">Papua New Guinea</option>
<option value="PRY">Paraguay</option>
<option value="PER">Peru</option>
<option value="PHL">Philippines</option>
<option value="PCN">Pitcairn</option>
<option value="POL">Poland</option>
<option value="PRT">Portugal</option>
<option value="PRI">Puerto Rico</option>
<option value="QAT">Qatar</option>
<option value="REU">Reunion</option>
<option value="ROU">Romania</option>
<option value="RUS">Russian Federation</option>
<option value="RWA">Rwanda</option>
<option value="SHN">Saint Helena</option>
<option value="KNA">Saint Kitts and Nevis</option>
<option value="LCA">Saint Lucia</option>
<option value="SPM">Saint Pierre and Miquelon</option>
<option value="VCT">Saint Vincent and the Grenadines</option>
<option value="WSM">Samoa</option>
<option value="SMR">San Marino</option>
<option value="STP">Sao Tome and Principe</option>
<option value="SAU">Saudi Arabia</option>
<option value="SEN">Senegal</option>
<option value="SRB">Serbia</option>
<option value="SCG">Serbia and Montenegro</option>
<option value="SYC">Seychelles</option>
<option value="SLE">Sierra Leone</option>
<option value="SGP">Singapore</option>
<option value="SVK">Slovakia</option>
<option value="SVN">Slovenia</option>
<option value="SLB">Solomon Islands</option>
<option value="SOM">Somalia</option>
<option value="ZAF">South Africa</option>
<option value="SGS">South Georgia and the South Sandwich Islands</option>
<option value="ESP">Spain</option>
<option value="LKA">Sri Lanka</option>
<option value="SUR">Suriname</option>
<option value="SJM">Svalbard and Jan Mayen Islands</option>
<option value="SWZ">Swaziland</option>
<option value="SWE">Sweden</option>
<option value="CHE">Switzerland</option>
<option value="TWN">Taiwan</option>
<option value="TJK">Tajikistan</option>
<option value="TZA">Tanzania, United Republic of</option>
<option value="THA">Thailand</option>
<option value="TLS">Timor-Leste</option>
<option value="TGO">Togo</option>
<option value="TKL">Tokelau</option>
<option value="TON">Tonga</option>
<option value="TTO">Trinidad and Tobago</option>
<option value="TUN">Tunisia</option>
<option value="TUR">Turkey</option>
<option value="TKM">Turkmenistan</option>
<option value="TCA">Turks and Caicos Islands</option>
<option value="TUV">Tuvalu</option>
<option value="UGA">Uganda</option>
<option value="UKR">Ukraine</option>
<option value="ARE">United Arab Emirates</option>
<option value="GBR">United Kingdom</option>
<option value="USA">United States</option>
<option value="UMI">United States Minor Outlying Islands</option>
<option value="URY">Uruguay</option>
<option value="UZB">Uzbekistan</option>
<option value="VUT">Vanuatu</option>
<option value="VAT">Vatican City State (Holy See)</option>
<option value="VEN">Venezuela</option>
<option value="VNM">Viet Nam</option>
<option value="VGB">Virgin Islands, British</option>
<option value="VIR">Virgin Islands, U.S.</option>
<option value="WLF">Wallis and Futuna Islands</option>
<option value="ESH">Western Sahara</option>
<option value="YEM">Yemen</option>
<option value="YUG">Yugoslavia</option>
<option value="ZAR">Zaire</option>
<option value="ZMB">Zambia</option>
<option value="ZWE">Zimbabwe</option>
</select>
</div>
</div>
<div class="form-group required">
<label class="col-md-2">Full Name</label>
<div class="col-md-10">
<input class="form-control" id="card_holder_name" name="card_holder_name" type="text" placeholder="Full Name" required />
</div>
</div>
<div class="form-group required">
<label class="col-md-2">Address 1</label>
<div class="col-md-10">
<input class="form-control" id="street_address" name="street_address" type="text" placeholder="Address 1" required />
</div>
</div>
<div class="form-group">
<label class="col-md-2">Address 2</label>
<div class="col-md-10">
<input class="form-control" id="street_address2" name="street_address2" type="text" placeholder="Address 2"/>
</div>
</div>
<div class="form-group required">
<label class="col-md-2">City</label>
<div class="col-md-10">
<input class="form-control" id="city" name="city" type="text" placeholder="City" required />
</div>
</div>
<div class="form-group required">
<label class="col-md-2">State / Province</label>
<div class="col-md-10">
<input class="form-control" id="state" name="state" type="text" placeholder="State/Province" required />
</div>
</div>
<div class="form-group required">
<label class="col-md-2">Postal Code</label>
<div class="col-md-10">
<input class="form-control" id="zip" name="zip" type="text" placeholder="Postal Code" required />
</div>
</div>
<div class="form-group">
<label class="col-md-2">Phone</label>
<div class="col-md-10">
<input class="form-control" id="phone" name="phone" type="text" placeholder="Phone" required />
</div>
</div><!--form group-->
<div class="form-group required">
<label class="col-md-2">Email</label>
<div class="col-md-10">
<input class="form-control" id="email" name="email" type="text" placeholder="Email" required />
</div>
</div>
<input type='hidden' name='sid' value='<?php echo TWOCHECKOUT_SELLER_ID;?>' />
<input type='hidden' name='mode' value='2CO' />
<input type='hidden' name='li_0_type' value='product' />
<input type='hidden' name='li_0_name' value='<?php echo $product_name;?>' />
<input type='hidden' name='li_0_product_id' value='<?php echo $order_id;?>' />
<input type='hidden' name='li_0_price' value='<?php echo $total;?>' />
</div>
</div>
<div class="col-md-12 text-center">
<input type="submit" class="btn btn-success btn-sm" value="Complete Checkout">
</div>
</form>
Consider using standard checkout instead. It lets the customer add the coupon code in the review cart step

Input alignment issues with labels

I am trying to align this forms inputs. They are all the same size, the problem is that the labels are forcing the inputs to push to the right. I am trying to get it to look like this:
http://imgur.com/1J958bb
But it looks like this:
.formWrapper
{
display: block;
width: 1000px;
margin: 0 auto;
}
.personalInformation
{
width: 480px;
display: inline-block;
}
.submissionInformation
{
width: 480px;
display: inline-block;
vertical-align: top;
}
.col-center ul, li
{
list-style-type: none;
}
.col-center hr
{
border-bottom: 1px solid #000;
}
.col-center input, select
{
border-color: #000 !important;
}
.col-center label
{
font-style: italic;
padding: 5px;
}
#saveForm
{
border: 1px solid #000;
width: 150px;
height: 40px;
}
.insert
{
text-align: center;
padding-bottom: 15px;
}
.insert b
{
font-weight: lighter;
font-size: 32px;
}
.insert p
{
font-style: italic;
}
.italic
{
font-style: italic;
}
.bold
{
font-weight: bold;
}
li
{
padding: 10px;
}
http://codepen.io/anon/pen/xbMrBW
<div class="formWrapper">
<div class="col-center">
<div class="personalInformation">
<form>
<b>Personal Information</b>
<ul>
<li id="foli1" class="notranslate ">
<label class="desc" id="title1" for="Field1">
First Name
</label>
<input id="Field1" name="Field1" type="text" class="field text medium" value="" maxlength="255" tabindex="1" onkeyup="" placeholder="First Name" />
</li>
<li id="foli2" class="notranslate ">
<label class="desc" id="title2" for="Field2">
Last Name
</label>
<input id="Field2" name="Field2" type="text" class="field text medium" value="" maxlength="255" tabindex="2" onkeyup="" placeholder="Last Name" />
</li>
<li id="foli3" class="notranslate ">
<label class="desc" id="title3" for="Field3">
Phone Number
</label>
<input id="Field3" name="Field3" type="text" class="field text medium" value="" maxlength="255" tabindex="3" onkeyup="" placeholder="Phone Number" />
</li>
<li id="foli4" class="notranslate ">
<label class="desc" id="title4" for="Field4">
Email
</label>
<input id="Field4" name="Field4" type="text" class="field text medium" value="" maxlength="255" tabindex="4" onkeyup="" placeholder="Email" />
</li>
<li id="foli5" class="notranslate ">
<label class="desc" id="title5" for="Field5">
Address
</label>
<input id="Field5" name="Field5" type="text" class="field text medium" value="" maxlength="255" tabindex="5" onkeyup="" placeholder="Address" />
</li>
<li id="foli6" class="notranslate ">
<label class="desc" id="title6" for="Field6">
City
</label>
<input id="Field6" name="Field6" type="text" class="field text medium" value="" maxlength="255" tabindex="6" onkeyup="" placeholder="City" />
</li>
<li id="foli15" class="notranslate ">
<label class="desc" id="title15" for="Field15">
State
</label>
<select id="Field15" name="Field15" class="field select small" tabindex="7" >
<option value="" selected="selected">
</option>
<option value="Alabama" >
Alabama
</option>
<option value="Alaska" >
Alaska
</option>
<option value="Arizona" >
Arizona
</option>
<option value="Arkansas" >
Arkansas
</option>
<option value="California" >
California
</option>
<option value="Colorado" >
Colorado
</option>
<option value="Connecticut" >
Connecticut
</option>
<option value="Delaware" >
Delaware
</option>
<option value="Florida" >
Florida
</option>
<option value="Georgia" >
Georgia
</option>
<option value="Hawaii" >
Hawaii
</option>
<option value="Idaho" >
Idaho
</option>
<option value="Illinois" >
Illinois
</option>
<option value="Indiana" >
Indiana
</option>
<option value="Iowa" >
Iowa
</option>
<option value="Kansas" >
Kansas
</option>
<option value="Kentucky" >
Kentucky
</option>
<option value="Louisiana" >
Louisiana
</option>
<option value="Maine" >
Maine
</option>
<option value="Maryland" >
Maryland
</option>
<option value="Massachusetts" >
Massachusetts
</option>
<option value="Michigan" >
Michigan
</option>
<option value="Minnesota" >
Minnesota
</option>
<option value="Mississippi" >
Mississippi
</option>
<option value="Missouri" >
Missouri
</option>
<option value="Montana" >
Montana
</option>
<option value="Nebraska" >
Nebraska
</option>
<option value="Nevada" >
Nevada
</option>
<option value="New Hampshire" >
New Hampshire
</option>
<option value="New Jersey" >
New Jersey
</option>
<option value="New Mexico" >
New Mexico
</option>
<option value="New York" >
New York
</option>
<option value="North Carolina" >
North Carolina
</option>
<option value="North Dakota" >
North Dakota
</option>
<option value="Ohio" >
Ohio
</option>
<option value="Oklahoma" >
Oklahoma
</option>
<option value="Oregon" >
Oregon
</option>
<option value="Pennsylvania" >
Pennsylvania
</option>
<option value="Rhode Island" >
Rhode Island
</option>
<option value="South Carolina" >
South Carolina
</option>
<option value="South Dakota" >
South Dakota
</option>
<option value="Tennessee" >
Tennessee
</option>
<option value="Texas" >
Texas
</option>
<option value="Utah" >
Utah
</option>
<option value="Vermont" >
Vermont
</option>
<option value="Virginia" >
Virginia
</option>
<option value="Washington" >
Washington
</option>
<option value="West Virginia" >
West Virginia
</option>
<option value="Wisconsin" >
Wisconsin
</option>
<option value="Wyoming" >
Wyoming
</option>
</select>
</li>
<li id="foli11" class="notranslate ">
<label class="desc" id="title11" for="Field11">
Zip
</label>
<input id="Field11" name="Field11" type="text" class="field text small" value="" maxlength="255" tabindex="8" onkeyup="" placeholder="Zip" />
</li>
<li id="foli17" class="notranslate ">
<label class="desc" id="title17" for="Field17">
Website
</label>
<input id="Field17" name="Field17" type="text" class="field text medium" value="" maxlength="255" tabindex="9" onkeyup="" placeholder="Website" />
</li>
<li id="foli19" class="notranslate ">
<label class="desc" id="title19" for="Field19">
Instagram
</label>
<input id="Field19" name="Field19" type="text" class="field text medium" value="" maxlength="255" tabindex="10" onkeyup="" placeholder="Instagram" />
</li>
<li id="foli20" class="notranslate ">
<label class="desc" id="title20" for="Field20">
Facebook
</label>
<input id="Field20" name="Field20" type="text" class="field text medium" value="" maxlength="255" tabindex="11" onkeyup="" placeholder="Facebook" />
</li>
<li id="foli21" class="notranslate ">
<label class="desc" id="title21" for="Field21">
Twitter
</label>
<input id="Field21" name="Field21" type="text" class="field text medium" value="" maxlength="255" tabindex="12" onkeyup="" placeholder="Twitter" />
</li>
</div>
<div class="submissionInformation">
<b>Submission Information</b>
<li id="foli22" class="notranslate ">
<label class="desc" id="title22" for="Field22">
Medium
</label>
<select id="Field22" name="Field22" class="field select medium" tabindex="13" >
<option value="" selected="selected">
</option>
<option value="Paint" >
Paint
</option>
<option value="Illustration" >
Illustration
</option>
<option value="Photographer" >
Photographer
</option>
<option value="Sculptor" >
Sculptor
</option>
<option value="Jewelry" >
Jewelry
</option>
<option value="Maker" >
Maker
</option>
<option value="Mixed Media" >
Mixed Media
</option>
<option value="Other" >
Other
</option>
</select>
</li>
<li id="foli23" class="notranslate ">
<label class="desc" id="title23" for="Field23">
Other
</label>
<input id="Field23" name="Field23" type="text" class="field text medium" value="" maxlength="255" tabindex="14" onkeyup="" placeholder="Other" />
</li>
<li id="foli24" class="notranslate " >
<label class="desc" id="title24" for="Field24">
Piece 1
</label>
<input id="Field24" name="Field24" type="file" class="field file" size="12" tabindex="15" />
</li>
<li id="foli25" class="notranslate " >
<label class="desc" id="title25" for="Field25">
Piece 2
</label>
<input id="Field25" name="Field25" type="file" class="field file" size="12" tabindex="16" />
</li>
<li id="foli26" class="notranslate notStacked ">
<fieldset>
<![if !IE | (gte IE 8)]>
<legend id="title26" class="desc">
Is this your first showing?
</legend>
<![endif]>
<!--[if lt IE 8]>
<label id="title26" class="desc">
Is this your first showing?
</label>
<![endif]-->
<span>
<input id="Field26" name="Field26" type="checkbox" class="field checkbox" value="Yes" tabindex="17" />
<label class="choice" for="Field26">Yes</label>
</span>
<span>
<input id="Field27" name="Field27" type="checkbox" class="field checkbox" value="No" tabindex="18" />
<label class="choice" for="Field27">No</label>
</span>
</fieldset>
</li>
</div>
</div>
</div>
Thank you in advance.
One solution would be to style the labels this way :
label{
display:inline-block;
width:150px;
}
The inputs will all be aligned! If you also want to have the inputs have a fixed width (like in your picture), don't forget to style them too.
Hope it helps :)

How to Modify XML File using Powershell

Hi Friends i want to modify some Text value in <Option Name="Activate">1</Option> to <Option Name="Activate">0</Option>. I am unable to locate node value <Option Name="Activate">1</Option> using powershell. below is the full code section in which i want to modify the Text. Please help.
<User Name="Richard">
<Option Name="Pass">b56e0b4ea4962283bee762525c2d490f</Option>
<Option Name="Containers">MasterVal</Option>
<Option Name="Max Limit Allowed">2</Option>
<Option Name="Limit Allowed">0</Option>
<Option Name="User Limit">0</Option>
<Option Name="Activate">1</Option>
<Option Name="Feedback"></Option>
<Option Name="ForceSsl">2</Option>
<FileAllowed>
<Disallowed />
<Allowed />
</FileAllowed>
<Authorizations />
<SpeedLimits DlType="0" DlLimit="10" ServerDlLimitBypass="2" UlType="0" UlLimit="10" ServerUlLimitBypass="2">
<Download />
<Upload />
</SpeedLimits>
</User>
Download XML File Here
So far i have tried Below Code but unable to complete. :(
$xml = New-Object XML
$XML.Load("D:\PSScript\BookStore.xml")
$xml.bookstore.Users.user |
Where-Object { ($_.Name -eq 'Richard')} |
Select-Object -Property Option
**Note : I want to use a condition here for example i want to change 1 Tag text value only for specific user, In short i want to modify text based on user id, Like where name = Richard change its <Option Name="Activate">1</Option> to <Option Name="Activate">0</Option> **
<BookStore>
<Settings>
<Item name="Admin port" type="numeric">88881</Item>
</Settings>
<Container>
<Containers Name="MasterVal">
<Option Name="Max Limit Allowed">0</Option>
<Option Name="Limit Allowed">0</Option>
<Option Name="User Limit">0</Option>
<Option Name="Activate">1</Option>
<Option Name="Feedback">
</Option>
<Option Name="ForceSsl">0</Option>
<FileAllowed>
<Disallowed />
<Allowed />
</FileAllowed>
<Authorizations>
<Authorization path="E:\BookMaster\RootFolder">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">0</Option>
<Option Name="FileDelete">0</Option>
<Option Name="FileAppend">0</Option>
<Option Name="pathCreate">0</Option>
<Option Name="pathDelete">0</Option>
<Option Name="pathList">1</Option>
<Option Name="pathSubdirs">1</Option>
<Option Name="IsHome">1</Option>
<Option Name="AutoCreate">0</Option>
</Authorization>
<Authorization path="E:\BookMaster\RootFolder\MST\reports">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">1</Option>
<Option Name="FileDelete">1</Option>
<Option Name="FileAppend">1</Option>
<Option Name="pathCreate">1</Option>
<Option Name="pathDelete">0</Option>
<Option Name="pathList">1</Option>
<Option Name="pathSubdirs">1</Option>
<Option Name="IsHome">0</Option>
<Option Name="AutoCreate">0</Option>
</Authorization>
<Authorization path="E:\BookMaster\RootFolder\MST\NT">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">1</Option>
<Option Name="FileDelete">1</Option>
<Option Name="FileAppend">1</Option>
<Option Name="pathCreate">1</Option>
<Option Name="pathDelete">0</Option>
<Option Name="pathList">1</Option>
<Option Name="pathSubdirs">1</Option>
<Option Name="IsHome">0</Option>
<Option Name="AutoCreate">0</Option>
</Authorization>
<Authorization path="E:\BookMaster\RootFolder\MST\WIN">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">1</Option>
<Option Name="FileDelete">1</Option>
<Option Name="FileAppend">1</Option>
<Option Name="pathCreate">1</Option>
<Option Name="pathDelete">0</Option>
<Option Name="pathList">1</Option>
<Option Name="pathSubdirs">1</Option>
<Option Name="IsHome">0</Option>
<Option Name="AutoCreate">0</Option>
</Authorization>
<Authorization path="E:\BookMaster\RootFolder\MST\Winsxs">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">1</Option>
<Option Name="FileDelete">1</Option>
<Option Name="FileAppend">1</Option>
<Option Name="pathCreate">1</Option>
<Option Name="pathDelete">0</Option>
<Option Name="pathList">1</Option>
<Option Name="pathSubdirs">1</Option>
<Option Name="IsHome">0</Option>
<Option Name="AutoCreate">0</Option>
</Authorization>
<Authorization path="E:\BookMaster\RootFolder\SXS">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">1</Option>
<Option Name="FileDelete">1</Option>
<Option Name="FileAppend">1</Option>
<Option Name="pathCreate">1</Option>
<Option Name="pathDelete">0</Option>
<Option Name="pathList">1</Option>
<Option Name="pathSubdirs">1</Option>
<Option Name="IsHome">0</Option>
<Option Name="AutoCreate">1</Option>
</Authorization>
</Authorizations>
<SpeedLimits DlType="1" DlLimit="10" ServerDlLimitBypass="0" UlType="1" UlLimit="10" ServerUlLimitBypass="0">
<Download />
<Upload />
</SpeedLimits>
</Containers>
<Containers Name="DMPL(9990)-D">
<Option Name="Max Limit Allowed">0</Option>
<Option Name="Limit Allowed">0</Option>
<Option Name="User Limit">0</Option>
<Option Name="Activate">1</Option>
<Option Name="Feedback">
</Option>
<Option Name="ForceSsl">0</Option>
<FileAllowed>
<Disallowed />
<Allowed />
</FileAllowed>
<Authorizations>
<Authorization path="E:\BookMaster\RootFolder\MST">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">0</Option>
<Option Name="FileDelete">0</Option>
<Option Name="FileAppend">0</Option>
<Option Name="pathCreate">0</Option>
<Option Name="pathDelete">0</Option>
<Option Name="pathList">1</Option>
<Option Name="pathSubdirs">1</Option>
<Option Name="IsHome">1</Option>
<Option Name="AutoCreate">0</Option>
</Authorization>
<Authorization path="E:\BookMaster\RootFolder\MST\NT\Report_9990">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">1</Option>
<Option Name="FileDelete">1</Option>
<Option Name="FileAppend">1</Option>
<Option Name="pathCreate">0</Option>
<Option Name="pathDelete">0</Option>
<Option Name="pathList">1</Option>
<Option Name="pathSubdirs">1</Option>
<Option Name="IsHome">0</Option>
<Option Name="AutoCreate">0</Option>
</Authorization>
</Authorizations>
<SpeedLimits DlType="1" DlLimit="10" ServerDlLimitBypass="0" UlType="1" UlLimit="10" ServerUlLimitBypass="0">
<Download />
<Upload />
</SpeedLimits>
</Containers>
</Container>
<Users>
<User Name="leonardo">
<Option Name="Pass">05538eb07b4dbf66b1da4ea9374ac8f5</Option>
<Option Name="Containers">MasterVal</Option>
<Option Name="Max Limit Allowed">2</Option>
<Option Name="Limit Allowed">0</Option>
<Option Name="User Limit">0</Option>
<Option Name="Activate">1</Option>
<Option Name="Feedback">
</Option>
<Option Name="ForceSsl">2</Option>
<FileAllowed>
<Disallowed />
<Allowed />
</FileAllowed>
<Authorizations />
<SpeedLimits DlType="0" DlLimit="10" ServerDlLimitBypass="2" UlType="0" UlLimit="10" ServerUlLimitBypass="2">
<Download />
<Upload />
</SpeedLimits>
</User>
<User Name="repturet">
<Option Name="Pass">e076fc6c4c8a245beec106646719f738</Option>
<Option Name="Containers">
</Option>
<Option Name="Max Limit Allowed">0</Option>
<Option Name="Limit Allowed">0</Option>
<Option Name="User Limit">0</Option>
<Option Name="Activate">1</Option>
<Option Name="Feedback">
</Option>
<Option Name="ForceSsl">0</Option>
<FileAllowed>
<Disallowed />
<Allowed />
</FileAllowed>
<Authorizations>
<Authorization path="E:\BookMaster\RootFolder\MST\NT">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">1</Option>
<Option Name="FileDelete">0</Option>
<Option Name="FileAppend">1</Option>
<Option Name="pathCreate">0</Option>
<Option Name="pathDelete">0</Option>
<Option Name="pathList">1</Option>
<Option Name="pathSubdirs">1</Option>
<Option Name="IsHome">0</Option>
<Option Name="AutoCreate">0</Option>
</Authorization>
<Authorization path="E:\BookMaster\RootFolder\MST">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">0</Option>
<Option Name="FileDelete">0</Option>
<Option Name="FileAppend">0</Option>
<Option Name="pathCreate">0</Option>
<Option Name="pathDelete">0</Option>
<Option Name="pathList">1</Option>
<Option Name="pathSubdirs">1</Option>
<Option Name="IsHome">1</Option>
<Option Name="AutoCreate">0</Option>
</Authorization>
</Authorizations>
<SpeedLimits DlType="0" DlLimit="10" ServerDlLimitBypass="0" UlType="0" UlLimit="10" ServerUlLimitBypass="0">
<Download />
<Upload />
</SpeedLimits>
</User>
<User Name="Anuj">
<Option Name="Pass">270a8eaf5877a08bc69bdde947f8e8b6</Option>
<Option Name="Containers">DMPL(9990)-D</Option>
<Option Name="Max Limit Allowed">2</Option>
<Option Name="Limit Allowed">0</Option>
<Option Name="User Limit">0</Option>
<Option Name="Activate">1</Option>
<Option Name="Feedback">
</Option>
<Option Name="ForceSsl">2</Option>
<FileAllowed>
<Disallowed />
<Allowed />
</FileAllowed>
<Authorizations />
<SpeedLimits DlType="0" DlLimit="10" ServerDlLimitBypass="2" UlType="0" UlLimit="10" ServerUlLimitBypass="2">
<Download />
<Upload />
</SpeedLimits>
</User>
<User Name="pallavi">
<Option Name="Pass">8d644bb6af9f1822de1d668d0ea6c36a</Option>
<Option Name="Containers">MasterVal</Option>
<Option Name="Max Limit Allowed">2</Option>
<Option Name="Limit Allowed">0</Option>
<Option Name="User Limit">0</Option>
<Option Name="Activate">1</Option>
<Option Name="Feedback">
</Option>
<Option Name="ForceSsl">2</Option>
<FileAllowed>
<Disallowed />
<Allowed />
</FileAllowed>
<Authorizations />
<SpeedLimits DlType="0" DlLimit="10" ServerDlLimitBypass="2" UlType="0" UlLimit="10" ServerUlLimitBypass="2">
<Download />
<Upload />
</SpeedLimits>
</User>
<User Name="piyush">
<Option Name="Pass">db699a999e4a6c8bd867720850d3007c</Option>
<Option Name="Containers">MasterVal</Option>
<Option Name="Max Limit Allowed">2</Option>
<Option Name="Limit Allowed">0</Option>
<Option Name="User Limit">0</Option>
<Option Name="Activate">1</Option>
<Option Name="Feedback">
</Option>
<Option Name="ForceSsl">2</Option>
<FileAllowed>
<Disallowed />
<Allowed />
</FileAllowed>
<Authorizations />
<SpeedLimits DlType="0" DlLimit="10" ServerDlLimitBypass="2" UlType="0" UlLimit="10" ServerUlLimitBypass="2">
<Download />
<Upload />
</SpeedLimits>
</User>
<User Name="Richard">
<Option Name="Pass">b56e0b4ea4962283bee762525c2d490f</Option>
<Option Name="Containers">MasterVal</Option>
<Option Name="Max Limit Allowed">2</Option>
<Option Name="Limit Allowed">0</Option>
<Option Name="User Limit">0</Option>
<Option Name="Activate">1</Option>
<Option Name="Feedback">
</Option>
<Option Name="ForceSsl">2</Option>
<FileAllowed>
<Disallowed />
<Allowed />
</FileAllowed>
<Authorizations />
<SpeedLimits DlType="0" DlLimit="10" ServerDlLimitBypass="2" UlType="0" UlLimit="10" ServerUlLimitBypass="2">
<Download />
<Upload />
</SpeedLimits>
</User>
</Users>
</BookStore>
Your main problem is you need to treat option elements as arrays. I copied your xml snippet to a file called test.xml and this code works (I'll explain how I parsed through your xml file at each step to show where Option is displaying as an array):
[xml] $info = Get-Content test.xml #Shorthand for New-Object..Load
#This command isn't necessary but is helpful when looking for an attribute
$info | Format-List *
#From above command saw that $info.User is the base document element
$info.User
#showed Attribute in Option
$info.User.Option
#displayed an array element with Attribute as the 5 (6th cause you start at 0) index
$info.User.Option[5]
#displayed Name and #text attributes with #text = 1
$info.User.Option[5].'#text' = "0"
#updated #text attribute to 0
From this you should be able to modify your script to work with the full xml file.
As your still having problems, a better solution would be to adjust your xml so you can access each user as a full object rather then parsing through attributes:
<User>
<name>Richard</name>
<pass>b56e0b4ea4962283bee762525c2d490f</pass>
<containers>MasterVal</containers>
<maxLimit>2</maxLimit>
<minLimit>0</minLimit>
<userLimit>0</userLimit>
<activate>1</activate>
<feedback></feedback>
<forceSsl>2</forceSsl>
<FileAllowed>
<Disallowed />
<Allowed />
</FileAllowed>
<Authorizations />
<SpeedLimits DlType="0" DlLimit="10" ServerDlLimitBypass="2" UlType="0"
UlLimit="10" ServerUlLimitBypass="2">
<Download />
<Upload />
</SpeedLimits>
</User>
Then you can access each user as $info.User.Richard and change each activate tags using $info.User.Richard.activate = 0. If you cannot do this you'll need to use foreach:
[xml] $info = Get-Content test.xml
foreach ($i in $info.BookStore.Users.User) {
if ($i.Name -eq "Richard") {
foreach ($e in $i.Option) {
if ($e.Name -eq "Activate") {
$e.'#text' = "0"
}
}
}
}
Then just write the xml back to the file. Note: Look at the use of select and select-xml if you want to simplify this later
Updated: with full answer given xml file

Forms - Select list not working, but check boxes do

What is the error that is not allowing the below select list to work?
Creating an email sign up form (Constant Contact). Using the Constant Contact form generator, I attempted to change the "mailing lists options" from check boxes to a drop down menu—but doing so caused the contact info to be added to all the mailing lists, and not the single list that was selected.
Select list code: (not working)
<select>
<option name="Customer Type" ID="">Please select...</option>
<option value="Architect/Designer" name="Lists[]" id="list_Architect/Designer" />Architect/Designer</option>
<option value="AV/Media/Broadcast" name="Lists[]" id="list_AV/Media/Broadcast" />AV/Media/Broadcast</option>
<option value="Command/Control" name="Lists[]" id="list_Command/Control" />Command/Control</option>
</select>
Check box code: (working)
<input type="checkbox" checked="checked" value="Architect/Designer" name="Lists[]" id="list_Architect/Designer" />
<label for="list_Architect/Designer">Architect/Designer</label><br />
<input type="checkbox" value="AV/Media/Broadcast" name="Lists[]" id="list_AV/Media/Broadcast" />
<label for="list_AV/Media/Broadcast">AV/Media/Broadcast</label><br />
<input type="checkbox" value="Command/Control" name="Lists[]" id="list_Command/Control" />
<label for="list_Command/Control">Command/Control</label><br />
you need select to be multiple
<select multiple='multiple'>
<option name="Customer Type" ID="">Please select...</option>
<option value="Architect/Designer" name="Lists[]" id="list_Architect/Designer" />Architect/Designer</option>
<option value="AV/Media/Broadcast" name="Lists[]" id="list_AV/Media/Broadcast" />AV/Media/Broadcast</option>
<option value="Command/Control" name="Lists[]" id="list_Command/Control" />Command/Control</option>
</select>