Dataset saving URL instead of number

Problem 1:
I have a dataset with a load of number fields used to record scores from a scoresheet. The fieldvalue type is set to number, and the user input text box is also set to number. Not all the input boxes will be filled as in a best of three game you may only have two sets of scores. If the user provides no input to the field then the dataset attempts to store this as a URL - rather than a number (or a 0 would be useful).

I want to sum these scores and present them back to the user. I am using an array to hold various calculation values as I need scores/winners etc for each game, set and overall match.
When I sum the values from the dataset and try to store them in my array with a no user input field it returns a set of appended strings:

//Scores[14] = itemObj.h11 + itemObj.h12 + itemObj.h13 + itemObj.h21 + itemObj.h22 + itemObj.h23 + itemObj.h31 + itemObj.h32 + itemObj.h33 + itemObj.h41 + itemObj.h42 + itemObj.h43 + itemObj.h51 + itemObj.h52 + itemObj.h53 + itemObj.h61 + itemObj.h62 + itemObj.h63 + itemObj.h71 + itemObj.h72 + itemObj.h73 + itemObj.h81 + itemObj.h82 + itemObj.h83;

(I’ve written this longhand so you can see what is happening. The below is how it is actually calculated in a function that is called to resolve each game)

Scores[14] = Scores[14] + homepoint;

The result with a no user entry to one field:


The result with the first three data values filled and then blanks:


Setting a 0 in the field, rather than leaving it blank, correctly stores a 0 as a number and the calculation resolves correctly. I don’t really want to make every user input field “required” and have the user set it to 0 as it is not often that a third game is played and there are already a lot of values to input.

Problem 2:
The image below shows the input scoresheet on the webpage.

The input boxes are numbered (#inputx):
4 7
5 8
6 9

When the user tabs from one input box to the next the sequence is:
1 2
3 5
4 6

This repeats across the whole page for all 8 sets of input boxes and is really counter intuitive. I don’t know what sets the order for which box gets tabbed to, as it clearly isn’t #input in ascending order.

Any help much appreciated :slight_smile:

Hi,
Regarding the first problem - we located the bug and working on a fix.
In the meanwhile you can just disregard the error you see in the collection manager as it has no affect on the actual site operation.

Regarding the second issue - You can control the order of the input fields when tabbing by clicking the element > Arrange > ‘Bring to front’ in the order you wish your users to enter the form.

Thanks for finding the bug!!

In the meanwhile you can just disregard the error you see in the collection manager as it has no affect on the actual site operation.
Except that it is affecting how the formulas calculate as the field has no value. Any way to set a default number in the field (such as 0)? Or is there a code snippet I can use to set empty fields to 0 - I don’t know what to match an empty or unset value to…

Thanks for the fix on tab order. My beta testers will be happy ! :smiley: