Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 passing blank fields to SPROC via ASP

Author  Topic 

steelkilt
Constraint Violating Yak Guru

255 Posts

Posted - 2002-12-19 : 11:23:46
As noted in a previous post, I'm sending ASP form data to an SPROC using parameters. However, if I leave an HTML checkbox unchecked, the routine fails b/c the SPROC is expecting a value from the checkbox.

I'm trying to figure out how to allow the form to pass a blank ("") field to the SPROC, at which point I would convert it to a NULL.

I'd like to do this for checkboxes, text fields, any HTML form controls that allow a user to simply skip the data entry and leave a blank box.

I'm not sure if it would be better to do the blanks-to-nulls conversion on the ASP page or in the SPROC.

thx

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-12-19 : 11:36:46
Use Javascript to set the value of the HTML control to "" before the form is submitted.

Do as much preparation/error checking of the data as you can on the client side.

Edited by - ValterBorges on 12/19/2002 11:38:37
Go to Top of Page

steelkilt
Constraint Violating Yak Guru

255 Posts

Posted - 2002-12-19 : 11:38:57
gotcha. will do. thx

Go to Top of Page
   

- Advertisement -