Help! JavaScript & input control

Hi,

Can someone help me to make this formula working in web? I mean in JavaScript…

list :=@DbColumn(“”;“”;“allapps”;1) ;

@If(@Contains(applName;list); @Failure(“The application you entered is already exist, Please choose ”Update of existing application”!”); applName)

When a user enter an application name in (applName) field, a control starting to look after the same name and if its found the user will gets alert message to choose other alternative.

Thanks!

//R

Subject: Help!! JavaScript & input control

  1. Create a field which will hold @DbColumn formula to retrieve all the values. The field should have “Allow multiple values” option enabled. (say field field1)

  2. Write javascript code to get all the values from above created field in to a javscript variable.

var fieldvalue = document.forms[0].field1.value;

  1. loop through all the “fieldvalue” and then check whether it matches what the user has entered in applName field.

You can use the foll. code to get handle to applName field -

document.forms[0].applName.value

  1. If value is present then alert the user otherwise continue with rest of the code.

–Phani

Subject: RE: Help!! JavaScript & input control

Thanks… Can u help in details?//R

Subject: Please Help!! JavaScript & input control

Thanks for your ideas but it did not work and I don’t know how to write the Js code for this ideas :((//R

Subject: Help!! JavaScript & input control

I think you’ve got a few options:1. Create a hidden field, which contains your list :=@DbColumn(“”;“”;“allapps”;1) formula.

Then use javascript to check if the string user enter exist in the list

  1. Use agent to check

  2. Use xml to check whether the data exist in a view

Regards

Rusyinni

Subject: Help!! JavaScript & input control

Try this. This is just an idea. You may have to modify to suit your needs.

The following will be on at the top your form with passthru:

in the onBlur event of your applName field place the following js code:

var list = dbColVals.split(“,”)

listlen = list.length

for (var i=0;i<listlen;i++) {

if (this.value) == list[i]) {

alert(“The application you entered is already exist, Please choose ”Update of existing application”!”);

return false;

}

}

HTH

Sai