Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- This is the sample code for a classic Search Bar widget, that will be pointing your website to the eviivo Booking Engine.  The Search Bar will need to be placed in the desired space in your website.
<!-- IMPORTANT! In order for the link to work, you need to replace the variable (https://URLLink) by the URL that matches your website implementation as detailed in the eviivo Help documentation  -->

<!-- 
Technical requirements 
* jQuery 
* jQueryUI 
* jQuery UI CSS 
-->

<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.13.0/jquery-ui.min.js" integrity="sha256-hlKLmzaRlE8SCJC1Kw8zoUbU8BxA+8kR3gseuKfMjxA=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.0/themes/smoothness/jquery-ui.css">

<style>
	/* Copy and insert the CSS code here below this line. The "CSS" code is visible in the middle "CSS" window --> 
	
	DATE FIELDS:  background colour for calendar headers */
	.ui-widget-header {
		background: #ffffff;
	}
</style>

<script type="text/javascript">
	// Copy and insert the JavaScript code here below this line.  The "JS" code is visible in the last "JS" window -->
</script>

<div class="ev-searchbox">

	<!--
   * Replace the expression https://URLLink below by the URL link that is specific to your website, as provided in eviivo's help documentation.
  -->
	<form id="ev-availabilitySearchResults" action="https://URLLink" method="GET" name="availabilitySearchResults">

		<div class="ev-startDate ev-options">
			<!-- Change or Translate the word "Arrival" below to suit your needs-->
			<label for="startdate" class="ev-label">Arrival</label>
			<input id="startdate" type="text" name="n" value="" class="ev-input" />
			<input id="startdate1" type="hidden" name="startdate" value="" />
		</div>

		<div class="ev-endDate ev-options">
			<!-- Change or Translate the word "Departure" below to suit your needs-->
			<label for="enddate" class="ev-label">Departure</label> <!-- Translate -->
			<input id="enddate" type="text" name="b" value="" class="ev-input" />
			<input id="enddate1" type="hidden" name="enddate" value="" />
		</div>

		<div class="mod-options">

			<div class="ev-adults ev-options">
				<!-- Change or Translate the word "Adults" below to suit your needs-->
				<label for="adults1" class="ev-label">Adults</label>
				<select name="adults1" class="ev-select">
					<option value="1">1</option>
					<!-- By default, if the guest does not input anything in the search bar, the search will default to 2 adults.  If you want the default to be a value other than 2, then remove the expression   [ selected="selected" ] which appears next to number 2 and copy it next to the value you want to use as default, to suit your needs-->
					<option value="2" selected="selected">2</option>
					<option value="3">3</option>
					<option value="4">4</option>
					<option value="5">5</option>
					<option value="6">6</option>
					<option value="7">7</option>
					<option value="8">8</option>
					<option value="9">9</option>
					<option value="10">10</option>
					<option value="11">11</option>
					<option value="12">12</option>
					<option value="13">13</option>
					<option value="14">14</option>
				</select>
			</div>

			<div class="ev-children ev-options">
				<!-- Change or Translate the word "Children" below to suit your needs -->
				<label for="children1" class="ev-label">Children</label>
				<select name="children1" class="ev-select">
					<!-- By default, if the guest does not input anything in the search bar, the search will default to 0 children.  If you want the default to be a value other than 0, then remove the expression   [ selected="selected" ] which appears next the value 0 and copy it next to the value you want to use as default, to suit your needs-->
					<option selected="selected" value="0">0</option>
					<option value="1">1</option>
					<option value="2">2</option>
					<option value="3">3</option>
					<option value="4">4</option>
					<option value="5">5</option>
					<option value="6">6</option>
					<option value="7">7</option>
					<option value="8">8</option>
					<option value="9">9</option>
					<option value="10">10</option>
					<option value="11">11</option>
					<option value="12">12</option>
					<option value="13">13</option>
					<option value="14">14</option>
				</select>
			</div>

		</div>

		<!--To change the booking button text, just replace "CHECK AVAILABILITY" below with the expression that best suits your needs -->

		<input class="ev-button" value="CHECK AVAILABILITY" type="Submit">
	</form>
	<div class="s-ev-num-nights"></div>
</div>
              
            
!

CSS

              
                /*STYLING THE SEARCH BAR */
.ev-searchbox {
	/*Search Bar font family*/
	font-family: Helvetica, Sans-Serif;
	/*Search Bar background colour*/
	background-color: #ffffff;
	/*Search Bar inner space*/
	padding: 10px;
	/*Search Bar width*/
	width: auto;
	/*Search Bar shadow, RGBa black colour colour. Opacity set to 25%*/
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
	display: inline-block;
}

/*STYLING THE FIELD HEADERS*/
.ev-searchbox .ev-label {
	display: block;
	/*Space below the field names*/
	margin: 0 0 3px 0;
	/*Font size for the field names*/
	font-size: 13px;
}

/*STYLING THE INPUT FIELDS*/
.ev-searchbox .ev-input,
.ev-searchbox .ev-select {
	/*Input fields font size*/
	font-size: 13px;
	margin: 0;
	/*Input fields inner spacing*/
	padding: 6px;
	width: 100%;
	box-sizing: border-box;
	/*Input fields border colour*/
	border: 1px solid #ededed;
	border-radius: 0px;
}

.ev-searchbox .ev-options {
	margin: 0;
	display: inline-block;
	/*Input dates field width*/
	width: 100px;
}
/*BOOKING BUTTON STYLING*/
.ev-searchbox .ev-button {
	/*Button Text colour*/
	color: #fff;
	/*Button Background colour*/
	background-color: #708090;
	/*Button inner spacing*/
	padding: 6px 12px;
	/*Button Font-size*/
	font-size: 14px;
	/*Button Font-weight (thickness) */
	font-weight: 500;
	text-align: center;
	margin: 0;
	cursor: pointer;
	border-radius: 6px;
	border: none;
	width: auto;
}
/*STYLING the Number of Nights message which appears after guests select dates*/
.ev-searchbox .s-ev-num-nights {
	/*Font size*/
	font-size: 12px;
	padding-bottom: 6px;
	/*Font colour*/
	color: #708090;
}

.ev-searchbox .ev-invalid {
	/*Styling how user errors are flagged: add red border if mandatory input fields are empty*/
	border: 1px solid rgb(255, 0, 0);
}
.mod-options {
	display: inline-block;
}

              
            
!

JS

              
                // $evjq SPECIALISED jQuery code to avoid conflicts
var $evjq = jQuery.noConflict();

$evjq(function () {
	// The next few lines set up different date formats.
	// 22 Apr 2022
	var dateFormatUser_EU = "dd M yy";
	// 12/22/2022
	var dateFormatUser_US_ex1 = "M dd yy";
	// 12/Apr/2022
	var dateFormatUser_US_ex2 = "mm-dd-yy";
	// Replace "EU" in the expresssion "dateformatUser_EU" below, by one of the above "US_ex1",  or "US_ex2" to switch to a US date format.
	var userDateFormat = dateFormatUser_EU; // Choose option from above

	// DO NOT MODIFY without professional advice
	var urlQueryParameterDateFormat = "yy-mm-dd";

	// TRANSLATE CALENDAR AND CALENDAR COMMANDS BELOW
	$evjq.defaultsLocalization = {
		closeText: "Done",
		prevText: "Prev",
		nextText: "Next",
		currentText: "Today",
		monthNames: [
			"January",
			"February",
			"March",
			"April",
			"May",
			"June",
			"July",
			"August",
			"September",
			"October",
			"November",
			"December"
		],
		monthNamesShort: [
			"Jan",
			"Feb",
			"Mar",
			"Apr",
			"May",
			"Jun",
			"Jul",
			"Aug",
			"Sep",
			"Oct",
			"Nov",
			"Dec"
		],
		dayNames: [
			"Sunday",
			"Monday",
			"Tuesday",
			"Wednesday",
			"Thursday",
			"Friday",
			"Saturday"
		],
		dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
		dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
		weekHeader: "Wk",
		firstDay: 1, // 1 - Monday, 0 Sunday
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ""
	};

	$evjq.datepicker.setDefaults($evjq.defaultsLocalization);

	$evjq("#startdate").datepicker({
		// DO NOT MODIFY without professional advice
		dateFormat: userDateFormat,
		onSelect: showDays,
		onClose: function (selectedDate) {
			var dParts = selectedDate.split("-");
			var in1Days = new Date(dParts[2] + "/" + dParts[1] + "/" + (+dParts[0] + 1));
			$evjq("#enddate").datepicker("option", "minDate", in1Days);
			$evjq("#enddate").datepicker("show");
		},
		minDate: 0,
		// DO NOT MODIFY without professional advice
		altFormat: urlQueryParameterDateFormat,
		altField: "#startdate1"
	});
	$evjq("#enddate").datepicker({
		// DO NOT MODIFY without professional advice
		dateFormat: userDateFormat,
		onSelect: showDays,
		minDate: 0,
		// DO NOT MODIFY without professional advice
		altFormat: urlQueryParameterDateFormat,
		altField: "#enddate1"
	});

	function showDays() {
		var start = $evjq("#startdate").datepicker("getDate");
		var end = $evjq("#enddate").datepicker("getDate");
		if (!start || !end) return;
		var days = (end - start) / 1000 / 60 / 60 / 24;

		$evjq(".s-ev-num-nights")
			// Change or Translate the text "Number of Nights" by another expression to suit you needs, for example:  "Length of stay".  The number of nights message appears after a guest has selected their stay dates to confirm the length of stay in number of nights.
			.text("Number of nights " + days)
			.show();
	}
	// DO NOT MODIFY without professional advice
	var date = new Date(),
		dateString =
			date.getMonth() +
			1 +
			"/" +
			date.getDate() +
			"/" +
			date.getFullYear().toString().substr(2, 2);
	$evjq("#startdate").datepicker("setDate", date);
	$evjq("#startdate,#enddate").blur(function () {
		$evjq("#startdate,#enddate").removeClass("ev-invalid");
	});
	// DO NOT MODIFY without professional advice
	$evjq("#availabilitySearchResults").submit(function () {
		if ($evjq.trim($evjq("#startdate").val()) === "") {
			$evjq("#startdate").addClass("ev-invalid");
			return false;
		}
		if ($evjq.trim($evjq("#enddate").val()) === "") {
			$evjq("#enddate").addClass("ev-invalid");
			return false;
		} else {
			$evjq("#startdate,#enddate").removeClass("ev-invalid");
			$evjq("#startdate,#enddate", this).attr("name", "");
			$evjq("#startdate,#enddate", this).attr("value", "");
			return true;
		}
	});
});

              
            
!
999px

Console