Form - Select Field - Ajax events problem

Hello,

I have a form, there are 2 select fields on it, lookup method automatic on both fields.

field1 - Use title = yes
field1 - Title internal value = 0
field1 - Title: “None selected!”

I make an Ajax event OnChange on field2. The onChange Ajax code is on field2 is:

if ({field1} != 0) {
{field1} = 0;
}

I would like, if the user select anything from field2, and field1 is not empty, than set the value of {field1} to 0.

It is not working. If the lookup method of field1 is Manual, than the Ajax event of field2’s onChange can manipulate field1.

Anyone can help?

BR,
Tibor

Hi Tibor,

have a look, this may help
http://www.scriptcase.net/forum/showthread.php?6472-ajax-processing-(the-built-in-function-of-sc)

regards
Mike

Hi Mike,

Thanks for your replay, but it didn’t help. In SC7 it works, in SC8 not.

Best regards,
Tibor

a lot of things don’t work in SC8, all software becoming better, SC becoming worse unfortunately

I tried the project mentioned in your link, and works on V8

Yes that’s right, slower and more unstable than SC7 :frowning:

Yes Giu, that was provided by you when I was stuck once a while ago :slight_smile: good you tried it because i’m planning to convert that project to V8 soon…

in general, sc8 yet needs a lot to become stable, everybody agrees, but we are optimistic after the good intervention from SC team recently, so lets hope for the best :slight_smile:

Hello,

I’ve got the solution:) Bit complex, but it works.
The problem is that there are two select field and the user can select only one of them. My primary idea is the when a user select from field1 than with the use of onchange I set the field2 value to 0, this is what doesn’t working.
By the way field1 points to customers table, field2 points to workers table.

Solution: you have to make two text field for field1, field2 which are contains the name of the record, instead of keyvalue. Than you have to reload the text fields at form onLoad.
You have to make 2 capture field link for the new text fields, which are points to the 2 grid application, from the user can select the record for field1 and field2. Than you have to make 2 onChange Ajax event for the 2 text fields. These Ajax onChange methods gets the key fields from the appropriate key fields from an sql statement, and puts the keyfields into the appropriate field1 and field2. Textfield1 onchange contains {field2} = 0 and {textfield2} = “” and TextField2 onchange contains {field1} = 0 and {textfield1} = “”
It is not too excat way, bacause it is assumes that there are no customers have same name and workers too.
(I hope I’m clear enough and sorry for my English)

I’m sure there are an easy way. I think just not enough data was provided to us. And you mentioned in your previous thread, thath my tests worked. :confused:

I can’t tell regarding the mobile part, but as far as I have seen it, current version of SC isn’t worse then SC 7. Doesn’t mean that there are not many things to fix. But as a heavy-user, I pretty happy with SC8.

Hello,

I simulated your problem with two fields of type select, using the same configuration as mentioned in the first post. I got a positive result (there was no an error). Could better illustrate your problem? Based on what you said above I had no problems.

Thank you.

Thomas, thanks for your efforts
Your testing and interference with us as I can see lately is really appreciated
Keep good care and works coming :slight_smile:
Cheers