Get variable value and pass it to textfield

Get variable value and pass it to textfield

Hi,

I am new to jQuery.

The idea is to use jQuery to create a 30 seconds sample from a mp3 song. What I need from the mp3 file is 2 timestamps, a begin and an end of the sample. These 2 values go in 2 textfields of the current form.

I use jPlayer to play a mp3 file. There is a variable called myPlayedTime. This variable changes all the time when the mp3 is playing.

I would like to save this value on a certain point when a submit button is pressed.

So this is happening:

1. mp3 file is playing
2. myPlayedTime is current position (in sec) of mp3
3. when submit button is pressed current value of myPlayedTime needs to be saved in a textfield

Can someone help me in the right direction how to do this?