JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.23/themes/base/jquery-ui.css">
<div id='accordion'>
<div class='group'>
<h3>
<a href='#'>Column One</a>
</h3>
<div>
<div class='group'>
<div class="boo">
<div class="overlay"></div>
<span id="CoulmTitle">Column 1</span><br/>
<div class="row">
<input type="text" name="mytext[]" id="field_1" value="Column Title"></input>
<label for="username">Please enter the title for the data under this column</label>
</div>
<div class="row">
<input type="text" name="mytext[]" id="field_1" value="Column Width (px)"></input>
<label for="username">Please enter initial (page load) width for this column</label>
</div>
</div>
<div class="row">
<div class="dropdown">
<select id="age" name="age">
<option>
Column Input Type
</option>
<option>
Simple Text Input
</option>
<option>
Descriptive Text Input
</option>
<option> Check/Tick</option>
<option>
Progress Bar
</option>
<option>
Date Picker
...
CSS
#accordion {
width:460px;
}
.boo input,.boo select {
background-image: url('http://webexpedition18.com/download/signup_form_WebExpedition18/images/input.png');
background-size:cover;
color: #888;
border: 1px solid #ccc;
font-family: Cantarell, Verdana, sans-serif;
font-weight: bold;
font-size: 15px;
width: 200px;
height: 35px;
padding: 0 5px;
margin: 5px 0;
float: left;
text-align:center;
border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
}
.boo label {
color: #666;
font-size: 12px;
font-weight: bold;
line-height: 14px;
float: left;
margin: 6px 0 6px 25px;
width: 180px;
}
.dropdown select {
background-image: url('http://webexpedition18.com/download/signup_form_WebExpedition18/images/input.png');
background-size:cover;
color: #888;
border: 1px solid #ccc;
font-family: Cantarell, Verdana, sans-serif;
font-weight: bold;
font-size: 15px;
width: 210px;
height: 35px;
padding: 0 5px;
margin: 5px 0;
float: left;
text-align:center;
border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
}
.row {
float:left;
}
select .lt { text-align:left; }
.ui-accordion .ui-accordion-content {
padding: 1em 20px;
border-top: 0;
margin-top: -2px;
position: relative;
top: 1px;
margin-bottom: 2px;
overflow: auto;
display: none;
zoom: 1;
}
.AddNewColumn {
width:458px;
height:25px;
}
JavaScript
$(function() {
$('input').focus(function() {
if (!$(this).data("DefaultText")) $(this).data("DefaultText", $(this).val());
if ($(this).val() != "" && $(this).val() == $(this).data("DefaultText")) $(this).val("");
}).blur(function(){
if ($(this).val() == "") $(this).val($(this).data("DefaultText"));
});
function create_accordian(str) {
$( str )
.accordion({
header: '> div > h3',
autoHeight: false,
active: false,
collapsible: true,
})
.sortable({
axis: 'y',
handle: 'h3',
stop: function( event, ui ) {
// IE doesn't register the blur when sorting
// so trigger focusout handlers to remove .ui-state-focus
ui.item.children( 'h3' ).triggerHandler( 'focusout' );
}
});
}
create_accordian('#accordion');
create_accordian('#accordion1');
create_accordian('#accordion2');
//create_accordian('#accordion3');
var MaxInputs = 8; //maximum input boxes allowed
var InputsWrapper = $("#accordion"); //Input boxes wrapper ID
var AddButton = $("#AddButton"); //Add button ID
var x = InputsWrapper.length; //initlal text box count
var FieldCount = 1; //to keep track of text box added
$(AddButton).click(function (e) //on add input button click
{
if (x <= MaxInputs) //max input box allowed
{
FieldCount++; //text box added increment
//add input box
$(InputsWrapper).append('<div class="group"><h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" role="tab" aria-expanded="false" aria-selected="false" tabindex="0"><span class="ui-icon ui-icon-triangle-1-e"></span><a href="#">Column...