This topic is locked
[SOLVED]

 Alert for a dropdown box

7/6/2010 4:22:04 PM
ASPRunnerPro General questions
J
Jay123 author

Hi!
I would like to ask how you can create an alert or popup message when an item is selected from a dropdown box. It doesn't matter which item is selected. I just wanted to create an alert or pop up message.
Thanks,

Jay

A
ann 7/7/2010

Jay,
use JavaScript API in the JavaScript Onload event on the Events tab.

Here is a sample:

var ctrl = Runner.getControl(pageid, 'FieldName');

function func() {

alert("Something");

};

ctrl.on('change', func);



where FieldName is your actual field name.

J
Jay123 author 7/7/2010

Hi Ann,
Thanks for the reply.
I forgot to mention that I am using APS Runner 6.1.
I was looking for something to be inserted on the Editor tab (HTML mode) like this:

document.getElementById("Field1").onclick or onchange
and then will create an alert (message box).
If there's another way, I would like to try it as well.
Thanks,

Jay

A
ann 7/7/2010

Jay,
the code is exactly as you told (add at the end of the page in the HTML mode on the Visual Editor tab):

<script>

document.forms.editform.value_Field1.onchange = function(){

alert("Something")

}

</script>
J
Jay123 author 7/7/2010

Thanks a lot, Ann. It worked!
Jay