JSFiddle - React, Tailwind, and code Playground
by ronnjoe
HTML
<select id="notificationGroup" name="notificationGroup" multiple>
<option value="all">All</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<textarea maxlength="5" id="message" name="message" placeholder="Max 1000 charecters"></textarea>
<button id="abc" >
Submit
</button>
<p id="qwerty">
</p>
</div>
<input type="text" id="abcdefd" />
<input type="text" id="expiryTime" />
JavaScript
$("#abc").on("click",function(){
var nodeListGroup = $('select#notificationGroup').map(function(){
return this.value
}).get();
console.log(nodeListGroup)
var ccd = $('select#notificationGroup').val();
console.log(ccd);
var dds = $('#message').val();
//var ccddd = "adsad \n asdad \n asd";
text = dds.replace(/\r?\n/g, '<br />');
$("#qwerty").html(text);
var foo = [];
$('#notificationGroup :selected').each(function(i, selected){
foo[i] = $(selected).val();
});
console.log(foo);
});
$("#abcdef").keypress(function(e){
console.log(e.target.textLength);
if(e.target.textLength >5) {
return false;
}
});
var d = new Date();
var abc = (d.getMonth()+1)+"/"+d.getDate() +"/"+d.getFullYear();
$( "#abcdefd" ).val(abc);//datepicker('setDate', new Date());
// $( "#expiryTime" ).datepicker();
$( "#abcdefd" ).datepicker({
//setDate:new Date(),
minDate: 0,
maxDate: "+2M",
dateFormat: "mm/dd/yy"
});
$( "#expiryTime" ).datepicker({
dateFormat: "mm/dd/yy",
showAnim: "slideDown",
beforeShow: function() {
var fromVal = $( "#abcdefd" ).val();
var d = new Date(fromVal);
return {
minDate: d,
maxDate: "+2M"
}
}
});
/*$("abcdefd").datepicker({
//setDate:new Date(),
dateFormat: 'mm/dd/yy',
showAnim: "slideDown",
beforeShow: function() {
var startDate = new Date(),
endDate = "";
return {
minDate: startDate,
maxDate: endDate
}
}
});*/
$("#notificationGroup").change(function (e) {
/* var notificationData = $("#notificationGroup").serializeArray();
var foo = [];
$('#notificationGroup :selected').each(function(i, selected){
foo[i] =...