Jump to content

Field Name to match FusionProFrame name


JoyceKeller

Recommended Posts

FusionPro frames named 1 through 15.

 

Field("myNumber") is selected from dropdown, values are 1 through 15.

 

Field("myNote") is multi-line text box.

 

example:

When user selects 2 from "myNumber" and enters "I'd like to teach the world to sing" into "myNote", it needs to fill FusionPro frame named "2".

 

If the user selects 3 from myNumber instead, the text would need to fill FusionPro frame 3.

 

I need to create a function or rule so that the correct FusionPro frame will receive the text.

This is as far as I got (I'm stuck):

If Field("myNumber") = FusionProTextFrame(name)

return Field("myNote")

 

Thank you for helping.

Link to comment
Share on other sites

  • 1 month later...

Joyce,

Not sure how to write that, but perhaps there is another solution we could try. If you could elaborate on the desired end result, perhaps I could help out with an alternative.

 

My guess is that you don't want the form congested with all of the possible entry text boxes, and if that is the case, we have a new UI Rule to help out.

 

Let me know

Link to comment
Share on other sites

Hi Rich, THANK YOU for responding! I'll have to take a look at the new UI Rule.

 

Basically, I'm creating a calendar, and we are going to give people a choice of 5 dates they can add notes to for each month.

 

I created a rule that applies to each FP box for each date of the year. 365 rules. There must be a better way to do it with a function in JS Globals.

 

There is a FusionPro Text Frame for each date. There are 5 dates to select for each month, and a note field to correspond with each date. I swap out "Jan01" with "Jan02" then "Jan03" through "Jan31" in the script below, for every date in the month. Then I do the next month.

 

I end up with 120 fields in the form (5 date fields and 5 note fields for each month). Is there a way to have fewer fields? Thank you for any thoughts on this.

 

if (FindTextFrame("Jan01"));

{

if (Field("JanDaySelector1")== "1")

return Field("JanNote1");

else

if (Field("JanDaySelector2")== "1")

return Field("JanNote2");

else

if (Field("JanDaySelector3")== "1")

return Field("JanNote3");

else

if (Field("JanDaySelector4")== "1")

return Field("JanNote4");

else

if (Field("JanDaySelector5")== "1")

return Field("JanNote5");

else

return "";

}

Link to comment
Share on other sites

This is specifically for FP Web. Answers I get from the FP Desktop forum don't always work on the web, and those folks will ask me to post it to the Web forum.:)

Well, there are kind of two parts to your question. When you ask, "Is there a way to have fewer fields?" that's an issue of how you design the job both in FusionPro Desktop and in MarcomCentral (FP Web), so that the data from the web form can be processed in the template.

 

As Rich alluded to, there may indeed be more efficient ways to design the job so that you don't need quite so many web form fields, or at least so that they don't all get shown in one giant web page with a huge scroll bar. That's the MarcomCentral-specific part of your question.

 

The other aspect of this, about writing the JavaScript code and creating/naming the text frames, is an FP Desktop question, even though the nature of the way the data is being presented to the composition from a web form is fairly specific to MarcomCentral (FP Web).

 

It might be helpful if you could collect up the job, with some sample data representing a few different variations on the web form input, and then post that to the FP Desktop forum.

 

That said, I'll try to answer this part of your question:

FusionPro frames named 1 through 15.

 

Field("myNumber") is selected from dropdown, values are 1 through 15.

 

Field("myNote") is multi-line text box.

 

example:

When user selects 2 from "myNumber" and enters "I'd like to teach the world to sing" into "myNote", it needs to fill FusionPro frame named "2".

 

If the user selects 3 from myNumber instead, the text would need to fill FusionPro frame 3.

 

I need to create a function or rule so that the correct FusionPro frame will receive the text.

Without seeing more of the job, I think you want to do something like this in OnRecordStart:

FusionProTextFrame(Field("myNumber")).content = Field("myNote");

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...