ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 25th, 2003, 02:44 PM
R2D2 R2D2 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Third chipset next to the master jumper...
Posts: 16 R2D2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Retrieving field default value

Hi,
I have 3 text fields in an Access db with each some default values.

I have an edit page where user's can edit those fields. The problem am having is if for instance I empty the field in the edition page, since am not allowing null or empty in them, when I save of course I receive an error telling me that this field is not allowing empty value.

Now what I would like to be able to do is this, when I save I'll check If the request.form("thefield") is empty, if so then instead of saving the empty value I want to return to the default value set in the db.

Any ideas how I could acheive this?

Thanks

Reply With Quote
  #2  
Old September 25th, 2003, 03:27 PM
holy holy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 1 holy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hey R2D2.
Did you try to put our field on your BD at "Null = TRUE"?

or

When you load your page save your 3 text fields in hidden fields.
When you'll save a field and is NULL take the value from the hidden fields..


Gl

Reply With Quote
  #3  
Old September 25th, 2003, 03:36 PM
R2D2 R2D2 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Third chipset next to the master jumper...
Posts: 16 R2D2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok..
The fields data type are allow null , empty string not allowed. Of course I could change the data type...
What I really want to do is be able to get the default value for this field. Must be a way?
Thanks

Reply With Quote
  #4  
Old September 25th, 2003, 03:44 PM
R2D2 R2D2 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Third chipset next to the master jumper...
Posts: 16 R2D2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hum.. :-) dont worry about this one anymore.. I'll simply check if the form field is empty, if yes then save the string that is specified in the field default value...

I think am tired... :-)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Retrieving field default value


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway