Good Morning,
After combing through the forums I couldn't find an answer for the the following scripting scenario.
(Or maybe I am asking the wrong question)
I have a Table (Name: InputTable) with a Header Row, and a footer Row (for a Grand Total Function), Add/Delete buttons, as well as Addition scripts.
The client has requested that if a dollar amount is put in one or any of Cell4, Cell5, Cell6, Cell7, Cell8, Cell9 or Cell10
Then Cell1 becomes a required field.
This Table must have an Initial count of 10 Rows, so I can't simple make Cell1 a Required field, because there could be blank/empty rows being submitted, and that would fire errors.
Could someone please provide an example of the Script I would need to Add to Row1, Cell1? (Or the resources of where to look)
And can this script be made to work on all Rows Added?
I don't do alot of scripting and I could sincerely use help on this.
Thank you all in advanced, I appreciate you taking time to help me out!
-Michelle
Solved! Go to Solution.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Okay, now you are really going to be able to tell how little I do scripting, lol..
The Script:
rawValue != null
does 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 mandatory
Cell1.mandatory = "disabled"; //cell1 is optional
Sorry if the question seems really basic - but thats totally me
Thank you for your help!
Views
Replies
Total Likes
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!
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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"
endif
And 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
Views
Replies
Total Likes
"Sum" function is normally used to calculate all rows... you should just write: Sun+Mon+Tues+Wed+Thurs+Fri+Sat
Views
Replies
Total Likes
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"
endif
However 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?
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies