smithme
(Marion Smith)
1
What I am trying to do is simple I think. I have a form with only three fields: Title, Product, and Feedback.
I have the Title field on the form but display: none.
In the Javascript I have:
fd.spSaved(function(result) {
fd.field(‘Title’).value = fd.field(‘Feedback’).value;
$(fd.field(‘Title’).$parent.$el).show();
});
I am turning on the Title with $(fd.field(‘Title’).$parent.$el).show(); as most browsers do not submit a hidden field.
The form isn’t saving.
What do I need to change?
Thank you
smithme
(Marion Smith)
2
I found the following post and tried applying these changes:
I moved my code to the OnClick of the Save button:
fd.spSaved(function(result) {
fd.field('Title').value = fd.field('Feedback').value;
$(fd.field('Title').$parent.$el).show();
});
fd.save();
Notice I added the fd.save();
It still didn't work.
smithme
(Marion Smith)
3
I made the Title field visible and modified the code in the OnClick to:
fd.field(‘Title’).value = fd.field(‘Feedback’).value;
fd.save();
I get a return error message that “You must specify a value for this required field.” for the Title field.
All I want to do is populate the Title field with the first 255 characters of the Multiple Line field.
smithme
(Marion Smith)
4
Ok, I got it to work with the following:
var memo = fd.field(‘Feedback’).value();
fd.field(‘Title’).value(memo.substr(1, 250));
fd.save();
Thank you
smithme
(Marion Smith)
5
My only issue now is how to hide the Title field and make sure it posts back on the form save.
smithme
(Marion Smith)
6
I have it working and no longer need any help. Thank you.
Dear Marion,
Glad to hear that! In case if anyone wonders about the code to hide a field, this should work:
$(fd.field('Title').$parent.$el).hide();