Hi I have a form, that i’m designing for the web and the notes client. i have a field with a list of options. based on the oprion the user selects it should then automatically fill in another field with the manager of that option area. I’m using the following formula which works in the notes client:
Subject: Automatically filling in fieldvalues on the web
Also, if the second field is display only, then this will not generate a handle in the web, Domino generates pure text and not a field. to get round this you can write HTMl to generate the dummy field or make the field editable and use the html attribute readonly=true ( IE only ).There are a number of other ways too, but just a pointer here
Subject: RE: Automatically filling in fieldvalues on the web
Andy i followed your example and it worked excellently in Notes except that on the Web the form shows up with the “unknown” value, but when i change the business are value, the “manager” value remains the same i.e - “unknown”.
Subject: Automatically filling in fieldvalues on the web
If you set the database to “Use JavaScript when generating pages” and set the BusinessArea field to “Refresh fields on keyword change”, the form will go back to the server to be recomputed. Oh, and that formula can be simplified to:
If you want to avoid the server-side refresh, you can use something like this in the onchange event of the BusinessArea field (this assumes that BusinessArea is a select – listbox, combobox or dialog list – field):
var personArray = split(‘Person One, Person Two, Person Three, Person Four’,', ');
var area = parseInt(this.options(this.selectedIndex).text.replace(/\D/g,‘’));
That’s a bit tricky if you’re not into JavaScript (or another C-based language), but it’s just a compact way of saying:
“When this field has changed, create an array from this list of names. Then find out what has been selected and get the associated text. Replace everything in that text that isn’t a number with nothing. Try to convert that to a real number. Set the value of OtherFieldName to ‘’ if the conversion failed, otherwise subtract one from the number and give me the corresponding member from that array of names you made.”
I have something like this too. You select a project nbr and its get name, mgr, things like that. I use a javascript new window. On the new form, I use a dialog box with aliases so that I see the one value (Area 1) and it retrieves the other values too. Then, the button on the form parses the values and re-writes the values on the original form. You make the fields on the form editable, but use javascript onfocus event to move the cursor to the next field. So, if someone tries, they jump. If you need some sample code, email me at ddubos@virtualcon.com