Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writing for forms 'value'.

Status
Not open for further replies.

jmorris

Programmer
May 2, 2000
15
AU
I am trying to write to a forms value, so that it can be passed onto the next template to be processed.

*********
I have a function:

function set_funct(funct){
document.all.pub_hol.funct.value = "funct";
}

*********
And call it with:
<input type=&quot;submit&quot; value=&quot;Add New&quot; OnClick=&quot;set_funct(add_new)&quot;>
*********
The form field I am trying to set the value of is called 'funct', but I just can't get it working.

Anyone got any ideas??

Thanks

Jason
 
Try the following:

( I am presuming that your form is called &quot;pub_hol&quot; )

function set_funct(funct){
document.pub_hol.funct.value = funct;
}

*********
And call it with:
<input type=&quot;submit&quot; value=&quot;Add New&quot; OnClick=&quot;set_funct(&quot;add_new&quot;)&quot;>
Mise Le Meas,

Mighty :)
 
hiee

well, i got it to work changin this:

function set_funct(func){
document.all.pub_hol.funct.value = func;
}

as u shuldnt have double defined variables (input name is funct too) & also without quotes


<input type=&quot;button&quot; value=&quot;Add New&quot; OnClick=&quot;set_funct('add_new')&quot; name=funct>

button - 'coz when it was submit it was restorin its default value any time (have no idea why, may be someone else wuld explain it 2 ya)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top