How to change a form field value pushing a button

J

Jim

I want to change the value of a form field when I push a
button. How can I do this? Im trying to write a java
script to do this, but it isn't changing the value. My
form name is form1, the field I want to set is P1. I have
created a javascript function that uses the setAttribute
method and I am trying to set the form1 attirbute P1
to "2".

Any other ideas?
 
P

Philip Sheard

I want to change the value of a form field when I push a
button. How can I do this? Im trying to write a java
script to do this, but it isn't changing the value. My
form name is form1, the field I want to set is P1. I have
created a javascript function that uses the setAttribute
method and I am trying to set the form1 attirbute P1
to "2".

Any other ideas?

form1.P1.value = "2";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top