Hello. I'd like to know if it's possible to access a variable created during on onpageload and have the "Rules for field definition" read and do something with the value. Are the javascript variables accessible from the confiforms?
Thanks.
Glen
Hi
You can call a JS function that you create/define in your page as shown here https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Field+Definition+Rules#ConfiFormsFieldDefinitionRules-RuncustomJavaScript
It is up to you how to access the other "variables" you may have on the page from that JS function
Alex
Alex,
The issue is this has to be done on a page load.
Here is the issue I have. When a user selects/pushes the "Edit" button for a record, I set a java variable to say the record is being edited, change the title of the popup window to say the user is editing the record. I then need to unhide a text box (audit) so the user editing the record can submit they reason why the record is being edited which would be a required field.
So I tried to unhide the "Audit" field using javascript which didn't work so I figured if I was able to update a hidden field using javascript and then use the rules to say if this field is not empty unhide the audit field it would all work just fine and what I needed.
Unfortunately trying to set the hidden field in the popup box has become a nightmare to try and set the value of the readonly field. I looked at your sample "
Using ConfiForms Field Definition rules with JavaScript action to get and set field values"
and tried that but that was an embedded form and I'm using a popup. So I figured if there was a rule to say looks at a java variable set a field or just have it be a condition where it would be able to unhide a field, I'd be golden. I'm far from an expert in javascript or the jquery stuff. I just usually hack my way thru this and get it done.
This is probably not the best approach I'm doing but it's where I'm currently at.
Regards,
Glen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Sound overly complicated to me to be honest, and I cannot understand why it shoudl be like that
It does not matter if it is a dialog or embedded... that is why we have a "reference to form" there - to target correct field
Changed example to be dialog... https://wiki.vertuna.com/display/TEST/Using+ConfiForms+Field+Definition+rules+with+JavaScript+action+to+get+and+set+field+values
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alex, yes it is complicated but the only way I could think about doing it. What would be a recommendation be as to make it less complicated.
What I need to do is to have a audit box appear when the data is edited. I'm not sure how to get this done without trying to set a hidden field and then have the audit field shows up when this field is set(the record is being edited). I was hoping there would be a variable accessible to the form that would say the "edit" button was pressed as opposed to the "new" record button.
Regards,
Glen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Unless I misunderstand something dramatically, but here is what I can offer (no JS at all - just one rule to do it all)
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Works perfect! Thank you! I never thought about it like that. So many configurable things it's amazing it's so simple!
Thank again!
Glen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.