javascript - Store table data using localstorage and passing it to a form -


right trying use html5's localstorage api grab value table, , pass value form.

for example, when user clicks on "sign today" on form: http://yft.ac/upcoming-workshops/, want information given row (date, time, location), heading above (ex: yft admissions insights) stored, , displayed in field "workshop interested in" on page: http://yft.ac/contact-us/.

i'm not best javascript here have far:

contact us:

$('input#workshop').text( localstorage.getitem('workshop') ); 

upcoming workshops page:

$('body').on('click', 'a.button', function(){     var index = $(this).parents('table').index('table');     var cur_workshop = $(this).parents('.innercontent').find('h3').eq(index).text();     localstorage.setitem('workshop', cur_workshop); }); 

i tried piece above code isn't working, hope jump start might more well-versed in javascript.

you have few problems in page.

  1. modernizer library not included - using modernizr.localstorage in code
  2. the localstorage.setitem('workshop', cur_workshop); code added before jquery library added page - since code used jquery move after inclusion of jquery
  3. look somewhere you/wordpress calling jquery.noconflict() - $ not refer jquery anymore use jquery instead of $ in code

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -