selecting random generated id/class

selecting random generated id/class

Hello.
New to whole this jQuery (and javascript altogether, heh) and so far it's been excellent, but now I'm in a small pickle.
Let's say I have list of forms generated from SQL database and every single one of them has to have unique id, so how I can select the specific item that is to be manipulated (changing values via php).

the $("#submit").click(function()) will trigger every submit buttons on the page, so how I can tell it to be "#<randomInteger>"

thought of passing the unique value with onClick="myfunction(unique_id)", but don't know how it goes with jQuery.

hope this made any sense