Joe Foley
Joe Foley

Reputation: 168

Update Anchor from function

In my process, I have a page that the user can select various items from a Listbox. These values are a Cell in a spreadsheet. A different column on that spreadsheet contains the URL of the spreadsheet. So after the user selects the value from listbox, the cell containing the URL is stored to a variable using a createServerClickHandler. What I can do already, is pass that URL back to a Textbox on the main page displaying the URL. What I'd like to do is have an Anchor appear on the main page so that, the user can click on it to open the spreadsheet that is the currently selected on in the Listbox.

var urlText = 'Click here to see selected spreadsheet'; var urlLink = bldrapp.createAnchor(urlText, **urlURL**).setId('spreadsheetURL').setVisible(true);

From my function(e) app.getElementById('infoURL').setText(**docToProcessURL**).setVisible(true);

The 'infoURL' is my Textbox on the main page. Is it possible to pass that value up to the 'urlURL' in the anchor?

Thank you,

Upvotes: 0

Views: 179

Answers (1)

Henrique G. Abreu
Henrique G. Abreu

Reputation: 17752

Yes, you can do it like this:

app.getElementById('spreadsheetURL').setHref(docToProcessURL);

Upvotes: 1

Related Questions