document.ready is probably not needed here because this is added at the end of the document and therefor all input fields should already be available.