Wednesday, 15 August 2012

Grab client-side field value in server-side JavaScript in XPages -



Grab client-side field value in server-side JavaScript in XPages -

i seem missing xpages. have button has server side js attempting value 2 existing fields on document. come in values in form , field values empty when button clicked.

var doc:notesdocument = currentdocument.getdocument(); var email = doc.getitemvalue("email"); _dump("email: " + email); var password = doc.getitemvalue("password"); _dump("password: " + password);

i can see values empty in log.nsf using "_dump" command.

when utilize client side js grab fields, populated -- can see in alert statements:

var doc = document; var email = doc.getelementbyid("#{id:email1}").value; alert(email); var password = doc.getelementbyid("#{id:password1}").value; alert(password);

i tried partial refresh on panel email , password fields exist, still didn't help.

do have save document first , grab document 1 time again field values? have pass field values in client side js , pass in scope (i don't think can done client side js)? simple solution not sure why happening.

thanks!

retrieve values straight info source:

var email = currentdocument.getvalue("email"); var password = currentdocument.getvalue("password");

client-side xpages xpages-ssjs

No comments:

Post a Comment