I'm working on a dataview web part in a MOSS 2007 environment which comes from a custom list. In this dataview web part, I'm wanting to link to the Attach Item form so users can attach some documentation for the item. What I'm struggling with is how to automatically trigger the UploadAttachment() javascript that executes when you navigate to EditForm.
My idea was to provide a clickable hyperlink in the dataview web part the links directly to the upload for for the corresponding list item. What are my options to achieve that result?
Edit: I can get there with the code below on the EditForm by passing in a query string parameter on my DVWP hyperlink, but I am wondering if there's a faster approach. The entire EditForm has to load before going to the upload screen.
<script type="text/javascript" src="/Resources/jquery.js"></script>
<script type="text/javascript" src="/Resources/SPServices.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var queryStringVals = $().SPServices.SPGetQueryString();
var up = queryStringVals["ToUpload"];
if (up = "1") {
javascript:UploadAttachment();
}
});
</script>