Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to modify an existing validation script dependent on a combo box drop down field selection

Engaged ,
Dec 24, 2022 Dec 24, 2022

I am presently working on an interactive PDF form project that relies on the selection of a name provided by a combo drop down box for populating form fields with data extracted from a multidimensional object stored in a hidden text field that resides on the form. Suffice it to say that the majority of operations such as adding a new record consisting of a name (entered into the combo box), making subsequent changes to form field values related to  property values associated with the name, as well as saving and deleting form field values to/from data stored inside a data object that resides in a hidden text field rely primarily on the value selected from or added to the combo box. While I have been successful populating the form fields with property values associated with the name selected from the combo box where both the name and property values match that extracted from the data object stored in the hidden text field, as well as deleting an existing name together with its property values from the stored data object using the form, I am presently trying to figure out where to add/implement the script to save data added or modified via the form fields to update that contained in the data object. Given the information provided thus far, while I am leaning toward modifying the existing validation script that presently serves to populate the form fields from data extracted from the data object, I am not quite sure if this is what needs to be done. Please note that it is not the script I require to add or update data to the data object using the form but rather how best to implement it. I should further state that I want to give the user the option to save changes to the data viewed per session whether it's an existing or new name added to the form when clicking on the combo box to select another name or revert back to the default value 'Lookup by Name' that essentially clears/resets the form. For those interested, I've provided the validation script below. The script populateFormFields() used to populate the form fields shouldn't be necessary to answer this post. The resetForm() should be self explanatory, while the script for a sole button on the form serves to change its color and readOnly property to simulate a grayed out button when needed. Any thoughts, suggestions regarding this subject matter are most appreciated. Thank you ahead of time.

dataField =getField("dataSource");
oVendors = JSON.parse(dataField.value);
btn=getField("btnDelete");
var oFld;
var oPassData = oVendors[event.value];
if(oPassData){
populateFormFields();
btn.textColor=["G",0];
btn.readonly=false;
btn.userName="Delete password record for '"+f.value+"' ?";
}
else{
this.resetForm("inf");
btn.textColor=["G",0.7];
btn.readonly=false;
}

 

     

TOPICS
How to , JavaScript , PDF forms
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 24, 2022 Dec 24, 2022

Can I give you a word of advice? If you want to get more replies to your queries, please try and keep them as concise and to-the-point as possible.

Also, try adding line-breaks to your sentences, so they're not one huge block of text.

Personally, I find it difficult to follow your posts and answer them the way you post your questions now.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 24, 2022 Dec 24, 2022

In reply to 'Personally, I find it difficult to follow your posts and answer them the way you post your questions now'. I suggest you take a course in remedial reading in English. In response to 'Can I give you a word of advice? ', I don't believe I asked for it. On another note, I would think the more information one can provide, the better. Sorry if I offended you and was unable to post my question according to your criteria in two short sentences using bullet points. I suggest when you have a moment to look up a post titled 'How to make dynamic form fields update?' from back in 2007. While this post may also not be considered concise and to the point per your standards, the information and manner in which it was provided appears to be justified given the subject matter.  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 24, 2022 Dec 24, 2022

To clarify my initial post, I probably should have added that unlike most interactive PDF forms, I am attempting to create an interactive PDF form that serves as a front end to view and manipulate data stored in an object that resides in a hidden text field on the form. For those familiar with database programming, this is similar to a database application that requires a user interface to view and manipulate data provided by a database whereas a conventional interactive PDF form is essentially an electronic digital rendering of a paper form. In reality, I have yet to come across an interactive PDF form used in this manner. This no doubt makes it somewhat more difficult to post questions regarding this subject matter much less understand it in which event I apoloize as it is not my intention to confuse anyone posting questions to the forum related to this subject matter.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 24, 2022 Dec 24, 2022

Yeah, I'm certainly not going to try to help now. You're the supplicant, right? Be nice.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 24, 2022 Dec 24, 2022

In response to 'Yeah, I'm certainly not going to try to help now. You're the supplicant, right? Be nice'. What's that supposed to mean? I wasn't rude in posting my initial query. I wasn't the one giving unsollicited advice telling someone how to post their query in order to receive more replies. Please reread my replies. They're not rude, disrespectful, nor intended to offend anyone. I am just wondering if it ever occured to some that what they perceive to be a lack of replies may be due to the difficulty of the question asked. I for one am not going to post a response to a query if it doesn't answer the question or isn't beneficial since doing so poses a disservice to both the community and one asking the question. If I'm missing something, I apologize.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 24, 2022 Dec 24, 2022

Yes, you were rude. My reply was unsolicited but was done politely and in an attempt to be helpful to you, and you replied by suggesting I need to improve my English reading skills... Well, maybe you should work on your writing skills, as you never seem to be able to get the point in your long, rumbling texts.

And trust me, whatever it is you're working on is by far less complicated than what myself and others here have done in the past. This is not the reason so many of your posts remain unanswered, but you can keep thinking that, if you wish.

 

I personally won't try to help you again, either. Good luck with it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 26, 2022 Dec 26, 2022
LATEST

In response to 'My reply was unsolicited but was done politely and in an attempt to be helpful to you, and you replied by suggesting I need to improve my English reading skills...'. Sorry you feel that way. While I disagree with what you have to say, let's just leave it at that can we?. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines