This topic is locked

how to add javascript to {build_edit_control}?

8/12/2008 5:40:40 AM
ASPRunnerPro General questions
V
vale_a author

I need to add customize a generated build_edit_control in order to add my own javascript function to an event.

Example:

{build_edit_control field="id_fornitore" mode="add" value=$value_id_fornitore}

I need to add a onchange event on this control

ex: onchange=Verifica();
I am working with Asp Runner version 5.1

I tried the example as stated in http://www.asprunner.com/forums/index.php?...pt+in+asp+pages but I didn't get to make it work.

Any help would be really appreciated,

thanks
Vale

V
vale_a author 8/12/2008

I need to add customize a generated build_edit_control in order to add my own javascript function to an event.

Example:

{build_edit_control field="id_fornitore" mode="add" value=$value_id_fornitore}

I need to add a onchange event on this control

ex: onchange=Verifica();
I am working with Asp Runner version 5.1

I tried the example as stated in http://www.asprunner.com/forums/index.php?...pt+in+asp+pages but I didn't get to make it work.

Any help would be really appreciated,

thanks
Vale


Got it!!

I've -dinamically- written my js function at BeforeProcess event for an "add.page". Then, I wanted to fire it by clicking on a dropdown menu generated by Asprunner. I entered the following snippet of code in the template page (before </body> tag):

{literal}<script>

document.editform.value_id_fornitore.onchange=function()

{

// this is the function call to my own js function defined at the start of the page

Verifica();

}

</script>{/literal}
It works just fine!