-
1. Re: Make Table Field Required When Other Table Fields are Filled In
Magus069 Mar 5, 2014 8:42 AM (in response to mlstechwriter71)Euhmmm... so if you change the value of one of the cells 4-10 you want cell1 to be required... so
verify all your cells if their value is (rawValue != null)
if only one is different then null use this to change the required field of Cell1:
Cell1.mandatory = "error"; //cell 1 is mandatory
Cell1.mandatory = "disabled"; //cell1 is optional
-
2. Re: Make Table Field Required When Other Table Fields are Filled In
mlstechwriter71 Mar 5, 2014 8:47 AM (in response to Magus069)Okay, now you are really going to be able to tell how little I do scripting, lol..
The Script:
rawValue != nulldoes this go on the individual cells 4-10?
Or does all of this scripting go on Cell1
rawValue != null
Cell1.mandatory = "error"; //cell 1 is mandatoryCell1.mandatory = "disabled"; //cell1 is optional
Sorry if the question seems really basic - but thats totally me
Thank you for your help!
-
3. Re: Make Table Field Required When Other Table Fields are Filled In
mlstechwriter71 Mar 7, 2014 6:31 AM (in response to mlstechwriter71)I think I have a better way to ask my question, and it may make for simplier coding.
Can someone advise on how I would I code javascript for this scenario:
Looking for Javascripting For: If a number appears in the Total cell, the Job # cell becomes required.
I'm assuming that the javascript would be on the Total cell and would be on a '"Calculate" event?
Thanks again for the help!
-
4. Re: Make Table Field Required When Other Table Fields are Filled In
Magus069 Mar 7, 2014 7:51 AM (in response to mlstechwriter71)Yea, it should be something like so...
If you are using Calculate event for Total... when you insert the value, verify if it's higher than 0
Your language should be in FormCalc for Calculate event so, it should be like this:
//Here you have your code to calculate the value and insert it in the total field.
if ($.rawValue gt 0) then
$.resolveNode("Job").mandatory = "error"
else
$.resolveNode("Job").mandatory = "disabled"
endif
-
5. Re: Make Table Field Required When Other Table Fields are Filled In
mlstechwriter71 Mar 7, 2014 8:38 AM (in response to Magus069)Well, I goofed something up, but it's not firing any error.
It just doesn't trigger any warnings, nothing happens at all... lol. Even When I hit the Submit Form Button to email it.
Anyone have suggestions on what I did wrong?
And I was wondering: The Job # field is marked User-Optional. I think that's correct for what I am trying to do here.
Here's what I have:
TopmostSubform.Page1.InputTable.Row1.Total::calculate - (FormCalc, client)
sum (Sun+Mon+Tues+Wed+Thurs+Fri+Sat)
//Mandatory Field
if($.rawValue gt 0) then
$.resolveNode("Job").mandatory = "error"
else
$.resolveNode("Job").mandatory = "disabled"
endifAnd the Sum function also stopped working... lol. I'm not having a good week with this form.
As Always, I am grateful for the assitance, thank you!
-Michelle
-
6. Re: Make Table Field Required When Other Table Fields are Filled In
Magus069 Mar 7, 2014 8:45 AM (in response to mlstechwriter71)"Sum" function is normally used to calculate all rows... you should just write: Sun+Mon+Tues+Wed+Thurs+Fri+Sat
-
7. Re: Make Table Field Required When Other Table Fields are Filled In
mlstechwriter71 Mar 7, 2014 9:17 AM (in response to Magus069)Okay, corrected the calculation - so Sum in now gone:
TopmostSubform.Page1.InputTable.Row1.Total::calculate - (FormCalc, client)
Sun+Mon+Tues+Wed+Thurs+Fri+Sat
//Mandatory Field
if($.rawValue gt 0) then
$.resolveNode("Job").mandatory = "error"
else
$.resolveNode("Job").mandatory = "disabled"
endifHowever if I keep this information from //Mandatory Field on down, the table will not calculate, and the mandatory coding doesn't do anything.
Is there something else I might be missing?
-
8. Re: Make Table Field Required When Other Table Fields are Filled In
Magus069 Mar 7, 2014 9:45 AM (in response to mlstechwriter71)alright well because when you calculate, your total always have to be the last line or else i dont think it reads the line below the total
so do something like this
TopmostSubform.Page1.InputTable.Row1.Total::calculate - (FormCalc, client)
var intTotal = Sun+Mon+Tues+Wed+Thurs+Fri+Sat
if (intTotal gt 0) then
Cell1.mandatory = "error"
else
Cell1.mandatory = "disabled"
endif
$.rawValue = intTotal
-
9. Re: Make Table Field Required When Other Table Fields are Filled In
mlstechwriter71 Mar 7, 2014 10:01 AM (in response to Magus069)THAT'S IT! WOO-HOO!
Thank you for having the patience of a saint and for not giving up on this
You Sir, Completely Rock!
Thank you again!




