Skip to Content
0
Former Member
Oct 18, 2006 at 04:28 AM

MVC javascript

19 Views

Hi Folks,

I have a quick question on MVC.

I'm trying to read the form element (inputField) value in the javascript but it's not identifying the element ID.

here is my code:

<i><script language="JavaScript" type="text/javascript">

var z = document.form1.ns01.value;

alert(z);

var y = document.getElementById("ns01").value;

alert(y);

</script>

<htmlb:inputField id = "ns01"

value = "Hello"

size = "5"

visible = "true" /></i>

I run the script on buton onClientClick event. It works fine in flowlogic but I need it in MVC. Am I missing any settings on MVC?

Please advise ASAP!

Thanks.