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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default values for form 1

Status
Not open for further replies.

Overmyhead2

Programmer
Jun 5, 2000
39
US
I want 0's to fill my form input boxes.. If users don't fill in all fields then the value of 0 will insert to db instead of nulls. How do I pre fill with a value?
<cfif IsDefined("FORM.L259F") AND #FORM.L259F# NEQ "">#FORM.L259F#<cfelse>NULL</cfif>

Victoria
 
put cfparams on your form action page, somewhere before your query

<cfparam name="FORM.L259F" default=0>
 
It is updating the db with 0's now .. but how can I get the user to see 0's in the form fields beforthey enter any data in?

Victoria
 
well if you have plain text fields, add a default value like so:
<input type="text" name="L259F" value="0">
 
Thanks.. Too easy.. I was looking in the wrong place..

Victoria
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top