Friday, June 19, 2009

Running a client-side script when a form segment loads

Form segments don’t provide a way to run a client script when the form segment is loaded. This can be somewhat limiting but it can be solved quite easily. Add a label to the form segment and set the label’s caption to

<script type="text/javascript">window.attachEvent("onload", Setup);</script> 

Then add a script to your form segment to do what ever you want

function Setup()
{
    alert("hello");
}

3 comments:

D Avery said...

Doogal, This trick came up on a google search and wasn't exactly what I needed, but gave me the inspiration for the solution to my problem. Many thanks and good luck on landing a killer next job!

ashutosh chauhan said...

Thanks a lot. It helps me after 3 years...

ashutosh chauhan said...

Thanks a lot... It helped me a lot...