Hello, I have a Forms Collection that looks up data in a SQL table and appends the rows based off the rows in SQL. One of the fields populated in the collection is Entry ID and another field in the collection is a custom HTML with the clients Web Client URL.
I'm trying to get the Entry ID input into the custom HTML so that clicking the link would open that specific Entry in the repository.
I found this JavaScript from a previous Forum post but I don't know enough about JS to be able to identify the classes/identifiers/variables that I need to change/set to make this work on my form.
$(document).on('change', '.InvoiceEntyID_C input', entryIDtoHtml); function entryIDtoHtml() { var doc_id5 = $(this).val(); // entry id of document var customHTML = $(this).closest('div.form-q').find('.customHTML .cf-custom'); var open5 = '&dbid=0&openfile="true"'; var target5 = 'target="_blank"';//Add this in to get link to open in new tab var openLink5 = doc_id5 + open5; var link5 = "<a " + target5 + "href=https://test.com/WebLink/ElectronicFile.aspx?docid=" + openLink5 +"'>View Invoice</a>"; customHTML.html(link5); }
Obviously I need to change href value in the code to the client URL but can someone please point out to me the other "custom" areas of this script so I can make the necessary changes to it or my Form to make this script work? I haven't made any changes to the code from the original post.
Here's my form info if necessary:
- My Collection
- Id: q4
- Class: None
- Entry ID Field (within collection)
- Id: q6
- Class: EntryID
- Custom HTML (within collection)
- id: q15
- Class: ReportLine (this is a class I created for in-line block display with other fields)