Hmm. You example looks like you tried 5 different things and none of it is consistent. Here are some things to fix up:
Your HTML message mentions "sourcetypes" but nothing else seems to refer to them.
Your default value for "username" looks like a value for a time range
You are trying to build a <chart> without using a chart or timechart command in your search.
You have a mysterious variable named $SearchHere$ which you aren't actually setting up as an input anywhere.
I second hiddenkirby's suggestion to checkout the ui-examples app.
Another approach could be to build a few dashboards using splunk's dashboard building wizard and review the XML it generates for you. This is not a bad way to get started. If you haven't walked though the forms how intro in the docs, that's another good place to start:
Forms intro
... View more