ITsolutionWizard
asked on
mvc, html 5, email
Below codes is on index.html
and how can i carry the id=search value to http://localhost:5489/Quote/BondInfo?
and how can i carry the id=search value to http://localhost:5489/Quote/BondInfo?
<form role="form" class="search-form" method="post">
<div class="form-group">
<input type="text" class="form-control" id="search" placeholder="Get our prices. Enter your email">
<button onclick="fnNext()" class="btn btn-theme" type="button">
Submit <i class="fa fa-chevron-right"></i>
</button>
<script>
function fnNext() {
window.location.replace("http://localhost:5489/Quote/BondInfo");
}
</script>
<br />
<label style="color:white;" >Your Information is safe & secure</label>
</div>
</form>
ASKER
i want to first save the email into local storage, then redirect to that webpage. Is it possible?
Sure - just store it in localStorage before doing the redirect:
$('#gotoNext').click(function() {
var email = $('#search').val();
var url = 'http://localhost:5489/Quote/BondInfo?search=' + email;
localStorage.setItem('emailAddress', email);
window.location.replace(encodeURI(url));
});
ASKER
And I just don't want to use local host any more can I add .. ?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
//HTML
Open in new window
//JqueryOpen in new window
If you want to carry on with your raw Javascript, then you can get the search value with a call to getElementById.