Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
default values for hidden fields
syal123
Can someone tell me how to set default value for a hidden field.
I tried the following code but it didnt work.
<item name="some_name">
<hidden>
<text><default>SomeDefaultValue</default></text>
</hidden>
</item>
using datacapture5.0.dtd in 6.5 TS.
Find more posts tagged with
Comments
JeremyH
I don't think it is possible like that in the current TS.
One option would be to use FormAPI to set a default value as the form initializes. This also gives you the flexibility not to set that value if the field is already populated.
syal123
i wonder if the 5.0 dtd specifies that the default value for a textfield can be set using the nested element <default></default> then why is it not allowing it to default the value even if the field is hidden.
and also if we would have to use the formAPI then why would they even allow some one to create a hidden text field or area. Why woult they even include that in the dtd. because it seems that it doesnt make any sense to let anyone drive the car without giving them the key.
A user can create a hidden field but cant assign a value to it without using form API.
Does any one have any solution.
Thanks in Advance
Adam Stoller
Personally I never found the lack of default values for hidden fields in the DCT to make sense either - but basically we use FormAPI too - just not quite the same way that it seems to be presented so far.
You define the field like you would normally (not hidden) - so you can stick in a default value as per the type of field it is - and then use FormAPI to hide the field on form initialization (i.e. within the init() function) - it works pretty well
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
cliffhanger
Try
<item name="some_name">
<hidden>
<default>SomeDefaultValue</default>
</hidden>
</item>
This has always worked for me
-cliff
Migrateduser
this isnt supported if u RTFM...it doesnt error but it wont pass the values to a Database for example. very annoying, i wish it would work vs using the formapi which is a pain (esp if u are trying to set default hidden values in replicants)
tst.650a.dg.pdf
<.hidden.>
Specifies that the data will not be shown in the data capture form. A
field may receive data from a callout program.
Note: You
cannot currently specify a default value.
Attributes:
required: See .
Subelements:
: See .
: See .
WoW Profile
TS 6.5 SP1
OD 6.0.2 SP1
cliffhanger
I am on 6.1 datacapture5.0 dtd, and haven't encountered any issue in pushing the hidden default value to the database using DD.
Syal is using datacapture5.0 dtd. So, I don't think he should have any problem using this.
-cliff