- March 8, 2010 at 6:21 pm #437
I have some check mandatory commands that have a read only field and some fields that are only visisble if another field is checked (a behavior sets their state to normal or hidden). The Read only field is always read only and the hidden fields are hidden by default. In preview mode when the hidden fields are visible, if I try to submit the form the Check Mandatory command does not work on the fields that used to be hidden nor does it work on the read only field. Is this a glitch in preview mode or is this is expected? If so, is there a work around for my use case?March 9, 2010 at 9:29 am #5128
very hard to say, depends on how you are handling this in the script actions.
rather than ‘preview’ look at using the DEBUG and you will see the scripts run as you run these actions to help you see if all your ‘check mandatory’ scripts are being called as you wantMarch 9, 2010 at 3:21 pm #5141
Yup, I’ve checked in debug and the first check mandatory is working. To simplify what I am doing I moved all of my check mandatory’s into one check mandatory command and tried to submit with basically an empty form. Some of the fields are being “flagged” as mandatory indicated by the red border and others are not even though they should be. I could send the form in through a ticket.March 9, 2010 at 3:38 pm #5144
First check Mandatory ? you have more than one I assume then. Do you not see the others being called? if you are not, have you some conditions in the script that are causing them to be skipped depending on specific entries on the form
try adding in some ‘show message’ scripts in your script (with different messages)and then ‘debug’ so you will see what path your scripts are taking and why then these other ‘check mandatory’ actions are not being invoked..
and even will help you see if the script is running but the field in that check mandatory is being recognised as ‘answered’
If you still can’t find it, send over the form with your ‘show messages’ as the break points explaining what fields you expect to see as ‘flagged’ and which ones you don’t and we can have a lookMarch 9, 2010 at 4:24 pm #5148
Well like i said I’ve moved everything to a single check mandatory command, completely by passing the logic I had with the others. When that single Check mandatory gets called in the submit behavior (verified with debugging) not all of the fields are showing as mandatory (i mean do not have a red border). If I hover over the fields, the “tool tip” shows with the mandatory message, but thats kind of a problem if a user doesnt see the red border. On top of that, fields that I included in check mandatory that are read only are not showing the red border or the tool tip that displays when you hover over the fields.March 9, 2010 at 4:33 pm #5150
Sorry, but where you said ‘the first check mandatory is working’ that implies there are more than one. but from what you are saying now what sort of fields are involved ? not all of them WILL show with a red border initially so it may be better to look at handling this differently.. either setting up a check mandatory script for each field one after the other, where you could define seperate messages in each, even present some visual tips to users what fields are required (a red * for instance can be useful in this regard as its considered a common way to show ‘this field is required)
and if these fields are on different pages of your form run the check mandatory action on a page by page basis rather than all on a final ‘submit’ button where your users can be sent back to earlier pages
but also.. READ ONLY fields – your users can’t enter any data into these fields in this state so even if they were to be ‘not answered’ how are your users then going to enter in data to them where they are ‘read only’ ?March 9, 2010 at 5:01 pm #5151
Well the read only fields are filled by results from connect commands, they need to have specific values for integration with other systems later on, and are not things we want to leave up to the user to mess up. The dropdown that controls what is displayed in this particular read only field is filled with a connect command, and since connect commands don’t prepend an empty selection when results are added to a dropdown, I can’t use that for my check mandatory because it has a value set by default. Although I see when you use a predefined list with a dropdown it gets the blank first selection. It would be nice if that were the case when adding items to a dropdown through a connect command. Or it would be nice if you could set what value should be considered as unanswered. Like if you had “select” as your first option in the dropdown check mandatory would see that as not having a value.
You asked what fields were involved. They are all text inputs, dropdowns, and radiobutton lists. Some of the radio button lists I’ve just given them a default, but for others a default isn’t really appropriate and the user needs to make their own selection. One thing thats strange is that I have 2 radio button lists. Neither one is special in any way but both are required and do not have a default option selected. Both are in the same check mandatory command but only one of them shows the red border. So that doesnt make sense to me.
You say, “not all of them WILL show with a red border initially”, what are the exceptions for this?March 9, 2010 at 5:31 pm #5152
Ahh nevermind…i set all of the borders for my textboxes and radio button lists to none… I guess I am going to have to set them to the same as the background color so they’ll display the red border when the check mandatory command is executed. However I am still needing a solution for my read only fields. Either changing the check mandatory to include read only fields or by modifying dropdowns as I suggested in my previous post.March 10, 2010 at 10:29 am #5155
Still can’t grasp why you want to run a check mandatory on a read only field and especially on a drop down ? even if it was ‘not answered’ and this ‘check mandatory’ ran , the fact that it is read only will mean they can’t do anything and won’t be able to submit the data.
its like setting ‘check mandatory’ on a hidden field… if it fails the user will just see the ‘mandatory field isn’t answered’ message but wont be able to do anything about it
and then where you are populating this drop down from a connect action I can’t see why you want it to be read only there either ? you’d normally use a drop down for users to then make a selection from that list, but if you have it ‘read only’ they can’t
I wonder though, are your fields here initially set to be ‘normal’ (ie editable) and then you are setting them to read only later in other actions and before the submit ? You would normally not do this, but handle how the form field states are defined from the form ‘stage’ and ‘role’
see here: /Documentation/manual/html/field_access_and_field_states.htm
it is a lot easier/cleaner to manage field access this way than by ‘scripts’
but having looked at how a drop down object handles this with/without ‘read only’ there is different response from the check mandatory and I would see this as ‘expected’. You wouldn’t for instance set a field to read only if there was no data that could be entered
regarding your ‘Or it would be nice if you could set what value should be considered as unanswered’ you can do this using a condition based on the selection made and then either run a ‘check mandatory’ or present your own ‘show message’ based on what was either ‘checked or not checked’March 10, 2010 at 1:09 pm #5156
This is ‘expected’ in that Read only fields will not be checked from the Check Mandatory Command just as Disabled and Hidden fields won’t either. But I can see how this isn’t clear from the user guide and will refer this to be reviewed and updated for the futureMarch 10, 2010 at 2:55 pm #5157
Sorry, I didn’t explain the relationship of the drop down field to my read only fields very well. The dropdown field is not read only. It’s given a list of options from a database connect command and the user will select one of those options. When the selected index of the dropdown changes, that calls a behavior to “load” values into the read only fields. So they are editable in an indirect way. However, I couldn’t use a check mandatory on my dropdown because when they are populated by a connect command the system doesn’t prepend a blank option the same way a dropdown would that had manually entered options or if it was tied to a predefined list. In another case, my forms have a “customer select page” and after they select a customer a bunch of read only fields are given values through a connect command. I need to make sure the user has selected a customer. The way they select the customer is through a table that displays results from a query to the user, the user will then click a select button for the row of the customer they want and that will fill the read only fields. You describe using a “condition based on the selection made” and then running either a check mandatory or a show message. I can see how I would get a show message to work although I would like to avoid that because then I would have to manually change the border color of the fields to signify to the user that action needs to be taken on those fields. I don’t see a way to do it with a check mandatory since by default the dropdowns will be set to a value if i fill them with data from a connect command. I’m not trying to be difficult, but right now I’m going through the system before the rest of our form builders to establish some standards and I’d like to find the most straight forward method for these things as possible.March 10, 2010 at 4:07 pm #5158
I would work on the premise of K.I.S.S myself and probably wouldn’t look to over complicate things by changing properties of the object although I can see that may have some benefits.
Adding a red * is a very effective way of highlighting to users visually that a field HAS to be answered (in this case the dropdown and not the fields that are populated from the selection of the dropdown that may be hidden/read only), supplement that with a conditional script based on the ‘selection made’ and/or even use the ‘mandatory answer’ setting where you can define the specific message to present referring to the object they have to complete (you will need to publish to see how this works, it won’t show in ‘preview’ but check that out on a simple test form to see how it works
as to the drop down itself, that you are populating from a connect action. Have you looked at following the ‘connect’ action with a ‘Set Field’ action to the drop down where you set the value to <nothing>
I’d suggest setting up a simple test form where you can populate the dropdown similar to you have here already but then add on a button and under that button add a ‘set field’ to set the ‘caption’ of the dropdown and then in the value section.. select ‘text or number’ and add in a SPACE to the entry field, and then preview the form, get the drop down to populate (ie as you see at the moment) but then run the script under the other button to see how it sets the drop down to ‘not selected’ and then your ‘check mandatory’ will do what you want
Also though in terms of finding the most appropriate methods and seeing things like this, use the same ‘simple test form’ premise to check out other options. It can be easier to see how things work but also if you then have something that you think isn’t correct a lot easier to send over to us with details of what you see, what you want so we can see more clearly as well. And if there is something we can see that isn’t correct, getting that ‘example’ to the developers to check out is also then a lot easierMarch 10, 2010 at 4:48 pm #5159
I agree with keeping things simple, but I also want to take away as much possibility of error as I can, and if theres a way to screw something up the users will find it.
Following with the set field command will work. I didn’t know you could use it like that with a dropdown. Just had to turn off errors for a connect command but thats great!
I still think it would be a nice feature to be able to set a property for a field as its “default” value and if check mandatory is run on that field it would test if its equal to that default value. If it is than the user would be notified and have to fix it.
You must be logged in to reply to this topic.