Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
Passing values to Javascript using editbale Notes Fields with html type=hidden

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#NotesToJavascript or http://www.notesninjas.com/A555F9/nn.nsf/ByAlias/NotesToJavascript


Passing @formula values from notes to javascript.





If you have a field unid which is editable and has type=hidden in the html other properties you can access the value using javascript:

alert( window.document.forms[0].unid.value );

If the field has the defautl value of:

@Text(@DocumentUniqueID)

This is a nice way of beign able to access the unid in javascript for building pop up urls on the fly etc.

One problem with this technique is that the values is saved on a submit and in this case the unid changes.

The unid will then be wrong .

An easy way around this is to stick in the input translation event:

@Text(@DocumentUniqueID)

This will then be updated when the document is saved ready for when the document is read or edited again.

NB Might be worth putting a comment in the default value field as developers do not assume Input Translation is used on the web:

REM {updated on save in input ttranslation event};

@Text(@DocumentUniqueID)

 

I found this useful, hope you do too. If you have any ideas how else this can be used @username, @userroles etc let me know.

 

 

 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
Lotus Notes 5 All-in-one Certification Exam Guide by Libby Schwarz, Ben Malekzadeh
Sort out your CLP with this book.
See at: Amazon.co.uk | Amazon.com |