Question
Maybe it's just a newbie question, but it's really driving me crazy.
I need to get the content of some formfields to create a new topic with its name based on them. Just like this:
I've tried with
%FORMFIELD{"ProjectName" topic="WEB.TOPIC" alttext="Field doesnt found"}%
but it always displays alternative text, so it doesn't seems to find that field.
What should I do?
Environment
--
RaquelAlegre - 25 May 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
FORMFIELD refers to
TWikiForms not to HTML forms.
If you want to construct one form field from another, the only option I know of is to use javascript. You could also have an intermediary creator page that can do the text manipulations and present a new form with the appropriate field.
--
JustinLove - 25 May 2007
I believe this should work. Here's a slight variation on your form demonstrating use of formfield to populate field:
--
LynnwoodBrown - 25 May 2007
Thank you both

I've tried using javascript and it worked. It's quite simple! I've included a javascript function
function canSubmit(inForm)
which is called from the "onSubmit" parameter in the HTML form. I've defined some variables to get the content from the fields:
var inputProjectName = inForm.ProjectName.value;
...
and the i've defined the action here, with the javascript code, better than with de action parameter from the HTML form. This way, I can mix the variables from javascript and twiki:
inForm.action="%SCRIPTURLPATH{edit}%/%BASEWEB%/"+inputProjectName + "%GMTIME{$mo$day$year$hour$min$sec}";
This function is called when pressing the "submit" button and redirects the user to the edit view of a new topic with a name like this
ProjectName05302007081843
--
RaquelAlegre - 30 May 2007
Related support topics on
formfields:
AttachURLDoesntWorkInFormField,
BatchEditFormFieldValue,
CanAFormFieldGetDataFromTheTopic,
DateFieldPluginFormFieldIsEditable,
DeepRecursionUsingFormfieldInForm,
DisplayFormFieldinTopic,
DisplayFormfieldBasedOnTopicName,
DisplayTopicsBasedOnFormFieldSearch,
EvalVariableInFormfield,
FormFieldListPlugin,
FormFieldValueInMailNotify,
FormFieldValuesInsideTopic,
FormFieldsInExternalLinks,
FormFieldsNotCompletelyFilled,
FormatDataFromFormFieldCheckboxType,
FormfieldEmptyInFormattedSearch,
FormfieldTextareaSearchNotTruncatedProperly,
HiddenMandatoryFormFieldsNotHidden,
HowToCreateTopicNameFromFormField,
HowToEditFormFieldDataInBodyOfText,
HowToEditFormfieldsWithoutEdit,
HowToInitialiseFormFields,
HowToMetaSearchMultipleFormFields,
HowToSearchBasedonFormFieldContents,
HowToSearchForFORMFIELD,
HowToSearchForTopicNameInFormField,
HowToSearchFormFields,
HowToSearchFormFields2,
HowToSortSearchByDateFormField,
HowToUpdateFormFieldValuesWithSearches,
HowToUseFormfieldInIFCondition,
HowToUseParentFORMFIELDInINCLUDE,
InternationalCharactersInFormFields,
METAformfieldDisplayBroken,
MultipleDateValueFormfield,
PreventRenderingOfHtmlFormFields,
ProbleminGettingFormField,
RenderFormfieldsInText,
SEARCHFailWithFormFieldAfterUpgradeTo01Sep2004,
SearchBasedOnDateFormfield,
SearchForFormfieldsWithVar,
SearchFormatFormField,
SearchOnTwoOrMoreFormFields,
SearchResultOrderedByFormfield,
StoreFormFieldMetaFromPlugin,
TemplatesAndFORMFIELDS,
UrlParamInFormField,
UseAFormFieldDateToSortAList,
UsingMetaParentWithFormFields,
VarOrCalcInsideFormfieldInsideIf,
VariableInFormField
--
PeterThoeny - 30 May 2007