You need to provide more information about what you want the form to do. Maybe post a screen shot?
Your script has several errors that I can see. You declare "var f" 3 times. The 3 variables must have different names, like this:
var f = this.getField("cod")
f.value = "art51";
var g = this.getField("desc")
g.value = "coppia di contenitori 120X80";
var h = this.getField("prez")
h.value = "300";
thank you MichaelN
this is a screen of the final table with buttons that go to add data to the form. I wish that when I click on one of the buttons at the bottom of this adds the data to the table progressively so that if the first line is already busy, it goes to add it below. Hope it is not an impossible thing to achieve. Thanks for the reply
It is possible. You need to write a loop that iterates over all the fields in one of the columns, checking if they're empty. If so, then it populates that row with the new data.