>I need to generate a call for onChange of some controls generated in server-side. The code is (in the ASPX vb.net page):
>
>
>lcFuncion = "return MostrarValorCombo(this," + lcControlCombo + ",'" + oControl.Tabla + "','" + oControl.CampoCodigo + "','" + oControl.CampoDescripcion + "'," + lcValidar + ");"
>
> If oControl.EditBox.Attributes.Item("onChange") <> "" Then
> oControl.EditBox.Attributes.Item("onChange") = oControl.EditBox.Attributes.Item("onChange") + "&&" + lcFuncion
> Else
> oControl.EditBox.Attributes.Add("onChange", lcFuncion)
> End If
>
>So, in html, the code MUST look this way:
>
>,true)&& return Asignar
>
>But is generated this way:
>
>,true);&&return Asignar
>
>I don't put the ; or & and that cause to fail the script..
>
>How avoid it???
Mario;
You might try placing a space after the last & and before the last double quote. "&& "
If oControl.EditBox.Attributes.Item("onChange") <> "" Then
oControl.EditBox.Attributes.Item("onChange") = oControl.EditBox.Attributes.Item("onChange") + "&& " + lcFuncion
Else
oControl.EditBox.Attributes.Add("onChange", lcFuncion)
End If
Or try + “ “ + after your "&&"
Tom