Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 1st, 2005, 10:05 AM
Authorized User
 
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default Validating Numeric data

I have what should be a simple problem but I cannot seem to get the result I need

I am listing a record from a database for editing of which this is a part ...

<form method="post" action="lmadmin1.asp?Actionvar=update">

<label for="Pregroup">Pre-Group No.</label>
  <input id="Pregroup" name="Pregroup" value=" <% =rs("Pregroup") %>" />
   <br />
  <label for="br_no">BR No.</label>
  <input id="br_no" name="br_no" value=" <% =rs("br_no") %>" />
  <br />
  <label for="other_no">LMS No.</label>
  <input id="other_no" name="other_no" value=" <% =rs("other_no") %>" />
  <br />
<form method="post" action="lmadmin1.asp?Actionvar=update">

The database has unfortunatly many Numeric fields with nothing in them
and if an update is attempted it falls over because of a data trype mismatch

What I want to do is check if the field has no entry and if so replace it with a 0

Please Help !

Topshed
 
Old February 1st, 2005, 11:50 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Instead of setting recordset values directly to the input boxes
set the values to variables.if the variable is empty or null,set it to zero.

 
Old February 6th, 2005, 09:19 AM
Authorized User
 
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks I will give it a try

Topshed






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to insert varchar data in numeric column dhirajDac Classic ASP Components 3 March 31st, 2008 06:23 AM
Manipulate numeric data in binary files pkipe Pro VB 6 7 March 12th, 2008 03:35 PM
Validating string is numeric? crabjoe Classic ASP Basics 1 February 20th, 2008 10:43 AM
regular expression for validating numeric value Laxmikant_it ASP.NET 1.0 and 1.1 Professional 1 January 24th, 2007 07:26 AM
Display of 2 dimensional array numeric data oldrocketdog Visual Basic 2005 Basics 0 December 6th, 2005 10:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.