wrap with form

This commit is contained in:
techgaun 2017-03-30 13:17:39 -05:00
parent 8584e894d4
commit 8e17912802
No known key found for this signature in database
GPG key ID: 57FB3143221F7B30
2 changed files with 13 additions and 6 deletions

View file

@ -15,12 +15,14 @@
</div>
<div class="panel-body">
<div class="input-group">
<input id="repo" class="form-control" type="text" placeholder="techgaun/github-dorks">
<span class="input-group-btn">
<button onClick="fetchData()" type="button" class="btn btn-primary">Find</button>
</span>
</div>
<form id="form" class="form-horizontal" role="form">
<div class="input-group">
<input id="repo" class="form-control" type="text" placeholder="techgaun/github-dorks">
<span class="input-group-btn">
<button onClick="fetchData()" type="button" class="btn btn-primary">Find</button>
</span>
</div>
</form>
<div id='data-body' class="">
</div>

View file

@ -1,3 +1,8 @@
document.getElementById('form').addEventListener('submit', (e) => {
e.preventDefault()
fetchData()
})
function fetchData() {
const repo = document.getElementById('repo').value
const re = /[-_\w]+\/[-_.\w]+/