How to avoid %null% in Select Lists
746024May 13 2010 — edited Jul 21 2010Hi all,
Today I came up with a strange problem(atleast for me).
I have a select list in a form for which I want to display a null value(display value) as 'Select a Name' and when no name is selected I want the field to be blank in the database.
I left the return value for null option as blank then, when I click on "submit" that field stores as "*%null%*" into the database which is what I don't want in my database.
Let me tell you how exactly my page is working.
I have a form
Items:
P2_contactid --- hidden -- Primary key
P2_Name --- text box --- Mandatory
P2_Location -- Select list --- Optional field
P2_Phone -- Text -- Mandatory
P2_desc -- Text -- Automatically built with the change of values(using Javascript)
Header:
Java script to Pull the selected location and frame a description as
"P2_name, P2_location, P2_phone"
Page Process(Fetching and processing Manually):
Update contactdb set name=P2_name, Location=P2_Location, phone=P2_phone, desc=P2_desc where contactid=P2_contactid;
commit;
Now When I click on submit button leaving the Location field unchanged I get desc field as "P2_name, %null%, P2_phone" and location field as %null%.
Even the javascript also pulls the text in P2_location as %null%.
So can anyone tell me How can I avoid this %null%.
Thanks in advance,
Rams.