checkValidNewControl()

Pixelsilk API function to validate a control name--checks whether it conflicts with another control or field--requires the advanced-admin-access permission
Parameters:
name: the proposed name of the new control
type: the type of the new control

Output:
The function checkValidNewControl returns an object containing the result (true or false) and a message

Example:
In C#, write:
string name = "newControl";
string type = "controlType";
object validity = CheckValidNewControl(name, type);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/checkValidNewControl HTTP/1.1
HOST: www.example.com
Content-Length: 140
Content-Type: application/x-www-form-urlencoded
Cookie: auth=0204943C8C06...4561CA826C11

Request Data:
Unencoded Data:
json={
   "name":"ExampleTextWebbox",
   "type":"TextWebbox"
}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

Url-encoded Data:
json=%7b%0d%0a+++...%22%0d%0a%7d&token=7AdbNHZQBtwc...TEK8UvSUQ%3d

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=F1BC123CDBDA...A68245BF4CE; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 27

Response Data:
{"valid":true,"message":""}

JavaScript Example:
Method Call:
pixelsilk2.checkValidNewControl(input, callback)

Input Object:
{
    name:"UberHtmlWebbox",
    type:"HtmlWebbox"
}

Returned Data:
{
    "valid":true,
    "message":""
}

Back to Controls »