How to add extra text to input value result using jQuery -


my html form is:

<form id="search" action="form.html" method="get">     <input type="text" id="keyword" name="search" placeholder="keywords" /> </form> 

when type "test" , hit enter, go form.html?search=test

using jquery, how can add "xx-" on result, i.e. form.html?search=xx-test ?

thank you

use keypress catch enter event , make url redirect this.

$('#keyword input').bind('keypress', function(e) {     if(e.keycode==13){         var keyword= $('#keyword').val();         window.location = form.html?search=xx_' + keyword;     }  });​ 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo