jquery - Appending text to input field on submit -


i have form looks this:

<form>     <input type="text" value="" name="order[]" title="salmon"  />     <input type="text" value="" name="order[]" title="trout"  />     <input type="text" value="" name="order[]" title="halibut"  />     <input type="text" value="" name="order[]" title="crab"  />             <button type="submit">submit</button> </form> 

users inputting number value. when submit form want append title of each input submission. if user input "5" first input field, submit value "salmon - 5".

how achieve jquery?

i have working here http://jsfiddle.net/nlts9/6/. change type="submit" type="button"

        $('button').click(function () {             $('input[name="order[]"]').map(function () {                 $(this).val($(this).attr('title') + ' - ' + $(this).val());                 alert($(this).val());             });         }); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -