I have a custom list, and I want to create a direct link on the home page which points directly to adding a new item aka NewForm.aspx
So, I edited the page and add a link i.e. "Click Here" => (http://SharePointSite/Lists/WebEvents/NewForm.aspx)
But this link redirects to a new page which has the new form! I don't want that!
I want that if user clicks on "Click Here", then, The NewForm.aspx opens in Modal Dialog. I read that there is a way to accomplish this by using SP.UI.ModalDialog.showModalDialog("URL");
but how can I add the page? The link web part nor the hyperlink on the page will not accept that.
Could you please guide me ?
I tried <input type="button" value="Register" name="Go" onclick="SP.UI.ModalDialog.showModalDialog("http://SharePointSite/Lists/WebEvents/NewForm.aspx");" />
But it didn't work, besides, I wish to have the link as a text and not a button!