This topic is locked
[SOLVED]

 hidden field doesn't get posted to db

12/28/2017 5:38:06 PM
ASPRunner.NET General questions
A
Arkie author

I hide a field on an add page that I don't want others to see so I hide it with a javascript onload event of : pageObj.hideField("eto");
This works fine except that I want this information to be posted to the database and it doesn't.
If I hide it, it does NOT get posted. If I DO NOT Hide it, it does get posted?
So a hidden field is the same as being a blank field???
What's the best way around this? I tried to simply give the font a background color, but you can still see it if one mouses over it.

Solutions??

jadachDevClub member 12/28/2017



I hide a field on an add page that I don't want others to see so I hide it with a javascript onload event of : pageObj.hideField("eto");
This works fine except that I want this information to be posted to the database and it doesn't.
If I hide it, it does NOT get posted. If I DO NOT Hide it, it does get posted?
So a hidden field is the same as being a blank field???
What's the best way around this? I tried to simply give the font a background color, but you can still see it if one mouses over it.

Solutions??


Simply do not bring that field into the add page and populate it with before record added event.

values["eto"] = "something";

admin 12/29/2017

I second Jerry's answer. If you need something like this assign a value to this field in events like BeforeAdd or BeforeEdit. Do not display it at all on the page.

A
Arkie author 12/29/2017

Thanks... That'll work.
I suppose that hiding things on a page is really only good for if..then or yes/no type situations where you might want something to show up, or not, depending on something else.
~Joe

admin 12/29/2017

Right, hide/show is meant to be used for interactive purposes, show or hide something based on value selected in another field.