<commit_before><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>luga.form</title>

	<!-- Libs -->
	<script src="../../../lib/jquery/jquery.min.js"></script>
	<script src="../../../lib/handlebars.min.js"></script>
	<link rel="stylesheet" href="../../../lib/bootstrap/css/bootstrap.min.css"/>
	<script src="../../../lib/bootstrap/js/bootstrap.min.js"></script>
	<link rel="stylesheet" href="../../../lib/prism/prism.css"/>
	<script src="../../../lib/prism/prism.js"></script>

	<!-- Luga JS -->
	<link rel="stylesheet" href="../../../src/luga.css"/>
	<script src="../../../dist/luga.min.js"></script>
	<script src="../../../dist/luga.data.min.js"></script>

	<!-- Docs -->
	<link rel="stylesheet" href="../../luga.docs.css"/>
	<script src="../../luga-docs.js"></script>

</head>
<body class="luga-docs">

<div data-lugacsi="../../luga-docs-nav-main.inc" data-lugacsi-after="luga.docs.initMainNav"></div>

<div class="container-fluid">
	<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">

		<div class="panel panel-default">
			<div class="panel-heading luga-docs-api-heading">luga.form.toQueryString(rootNode, demoronize)</div>
			<div class="panel-body">
				Returns a URI encoded string of name/value pairs from fields contained inside a given root node.
				Only fields considered successful are returned: <br>
				<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.2">http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.2</a>
			</div>
			<table class="table table-bordered luga-docs-api">
				<th colspan="3">Parameters</th>
				<tr>
					<td>rootNode</td>
					<td>
						jQuery
					</td>
					<td>
						jQuery object wrapping the root node
					</td>
				</tr>
				<tr>
					<td>demoronize</td>
					<td>
						boolean
					</td>
					<td>
						If set to true, MS Word's special chars are replaced with plausible substitutes. Default to false
					</td>
				</tr>
			</table>
			<table class="table table-bordered luga-docs-api">
				<th>Returns</th>
				<tr>
					<td>A URI encoded string</td>
				</tr>
			</table>

		</div>

		<div class="panel panel-default">
			<div class="panel-heading luga-docs-api-heading">luga.form.toHash(rootNode, demoronize)</div>
			<div class="panel-body">
				Returns a JavaScript object containing name/value pairs from fields contained inside a given root node.
				Only fields considered successful are returned: <br>
				<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.2">http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.2</a>
				<br>
				Values of multiple checked checkboxes and multiple select are included as a single entry, with array value
			</div>
			<table class="table table-bordered luga-docs-api">
				<th colspan="3">Parameters</th>
				<tr>
					<td>rootNode</td>
					<td>
						jQuery
					</td>
					<td>
						jQuery object wrapping the root node
					</td>
				</tr>
				<tr>
					<td>demoronize</td>
					<td>
						boolean
					</td>
					<td>
						If set to true, MS Word's special chars are replaced with plausible substitutes. Default to false
					</td>
				</tr>
			</table>
			<table class="table table-bordered luga-docs-api">
				<th>Returns</th>
				<tr>
					<td>A JavaScript object containing name/value pairs</td>
				</tr>
			</table>

		</div>

	</div>

	<div data-lugacsi="../nav-local.inc"></div><commit_msg>Docs: Added sample code to luga.form<commit_after><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>luga.form</title>

	<!-- Libs -->
	<script src="../../../lib/jquery/jquery.min.js"></script>
	<script src="../../../lib/handlebars.min.js"></script>
	<link rel="stylesheet" href="../../../lib/bootstrap/css/bootstrap.min.css"/>
	<script src="../../../lib/bootstrap/js/bootstrap.min.js"></script>
	<link rel="stylesheet" href="../../../lib/prism/prism.css"/>
	<script src="../../../lib/prism/prism.js"></script>

	<!-- Luga JS -->
	<link rel="stylesheet" href="../../../src/luga.css"/>
	<script src="../../../dist/luga.min.js"></script>
	<script src="../../../dist/luga.data.min.js"></script>

	<!-- Docs -->
	<link rel="stylesheet" href="../../luga.docs.css"/>
	<script src="../../luga-docs.js"></script>

</head>
<body class="luga-docs">

<div data-lugacsi="../../luga-docs-nav-main.inc" data-lugacsi-after="luga.docs.initMainNav"></div>

<div class="container-fluid">
	<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">

		<div class="panel panel-default">
			<div class="panel-heading luga-docs-api-heading">luga.form.toHash(rootNode, demoronize)</div>
			<div class="panel-body">
				Returns a JavaScript object containing name/value pairs from fields contained inside a given root node.
				Only fields considered successful are returned: <br>
				<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.2">http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.2</a>
				<br>
				Values of multiple checked checkboxes and multiple select are included as a single entry, with array value
			</div>
			<table class="table table-bordered luga-docs-api">
				<th colspan="3">Parameters</th>
				<tr>
					<td>rootNode</td>
					<td>
						jQuery
					</td>
					<td>
						jQuery object wrapping the root node
					</td>
				</tr>
				<tr>
					<td>demoronize</td>
					<td>
						boolean
					</td>
					<td>
						If set to true, MS Word's special chars are replaced with plausible substitutes. Default to false
					</td>
				</tr>
			</table>
			<table class="table table-bordered luga-docs-api">
				<th>Returns</th>
				<tr>
					<td>A JavaScript object containing name/value pairs</td>
				</tr>
			</table>

<pre><code class="language-markup">&lt;form id="basicValue"&gt;
	&lt;input type="text" name="firstname" value="ciccio"/&gt;
	&lt;input type="text" name="lastname" value="pasticcio"/&gt;
	&lt;input type="radio" name="radio" value="yes" checked="checked"/&gt;
	&lt;input type="radio" name="radio" value="no"/&gt;
	&lt;input type="submit"/&gt;
&lt;/form&gt;</code></pre>

<pre><code class="language-javascript">luga.form.toHash(jQuery("#basicValue")
// => { person: { firstname: "ciccio", lastname: "pasticcio", }, radio: "yes" }</code></pre>

		</div>

		<div class="panel panel-default">
			<div class="panel-heading luga-docs-api-heading">luga.form.toQueryString(rootNode, demoronize)</div>
			<div class="panel-body">
				Returns a URI encoded string of name/value pairs from fields contained inside a given root node.
				Only fields considered successful are returned: <br>
				<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.2">http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.2</a>
			</div>
			<table class="table table-bordered luga-docs-api">
				<th colspan="3">Parameters</th>
				<tr>
					<td>rootNode</td>
					<td>
						jQuery
					</td>
					<td>
						jQuery object wrapping the root node
					</td>
				</tr>
				<tr>
					<td>demoronize</td>
					<td>
						boolean
					</td>
					<td>
						If set to true, MS Word's special chars are replaced with plausible substitutes. Default to false
					</td>
				</tr>
			</table>
			<table class="table table-bordered luga-docs-api">
				<th>Returns</th>
				<tr>
					<td>A URI encoded string</td>
				</tr>
			</table>

<pre><code class="language-markup">&lt;form id="basicValue"&gt;
	&lt;input type="text" name="firstname" value="ciccio"/&gt;
	&lt;input type="text" name="lastname" value="pasticcio"/&gt;
	&lt;input type="radio" name="radio" value="yes" checked="checked"/&gt;
	&lt;input type="radio" name="radio" value="no"/&gt;
	&lt;input type="submit"/&gt;
&lt;/form&gt;</code></pre>

<pre><code class="language-javascript">luga.form.toQueryString(jQuery("#basicValue")
// => "firstname=ciccio&lastname=pasticcio&radio=yes"</code></pre>

		</div>

	</div>

	<div data-lugacsi="../nav-local.inc"></div>
{'fraction_non_alphanumeric': 0.20559129143988125, 'fraction_numerical': 0.010390895596239486, 'mean_word_length': 3.101978691019787, 'pattern_counts': {'":': 0, '<': 245, '<?xml version=': 0, '>': 247, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3589725', 'n_tokens_mistral': 3400, 'n_tokens_neox': 2835, 'n_words': 595}