Increment automatically a number in text field
Hi all,
I'm newbie on LiveCycle Designer 8. I created a form with different field. Everything is working fine but I would like to automatically increment a number contained in textfield. for example, the default value is: RMA0001,
I would like, increase the last number each time that I click on special button. I visited the following topic, but sorry I don't understand: http://www.adobeforums.com/webx?128@@.59b4fc0d
Could you help please?
Let me know
Regards,
Alex
You'll have to supply some more information for us to help you. Among other things:
- What version of SUP are you using?
- What devices/emulators are you seeing this problem on?
- Have you added any custom code? If so, what is it?
Similar Messages
-
Adding user-defined number of text fields.
Okay I am having problems, obviously. I am developing a program where the user will enter X and Y values and the program will calculate the relational data. However, I can't even get a start.
First of all, the user defines the number of pairs of points they want to define. For example, they have 20 points, each with its own X and Y, so they click on 20 and then okay in the first window.
The next window will then take their answer and display X and Y text fields for as many points as they defined. However, I can't figure out any way to do this.
Feel free to run the program, the problem lies in the method setTextFields(). Help please!
import javax.swing.*; //FOR SWING COMPONENT CLASSES
import java.awt.*; //FOR CONTAINER CLASS
import java.awt.event.*; //FOR EVENT HANDLING
public class RegressInput extends JFrame
private JComboBox listJComboBox; //COMBO BOX TO HOLD HOW MANY PAIRS OF DATA POINTS THE USER HAS TO ENTER
private JButton answerButton; //BUTTON TO CLICK AFTER SELECTING PAIRS OF DATA POINTS
private JPanel textFieldTopPanel; //TEXT FIELD TOP PANEL
private JPanel textFieldBottomPanel; //TEXT FIELD BOTTOM PANEL
private JPanel textFieldPanel; //TEXT FIELD PANEL
private CardLayout cardSelector; //DECLARE CARD LAYOUT OBJECT
private JPanel cardDeck; //DECLARE CARD PANEL OBJECT
public RegressInput(String title)
super(title); //CALL SUPERCLASS CONSTRUCTOR
//CREATE A CONTAINER
Container container = getContentPane();
//INSTANTIATE CARD LAYOUT OBJECT
cardSelector = new CardLayout();
//INSTANTIATE PANEL OBJECT
cardDeck = new JPanel();
//SET LAYOUT OF CARD DECK PANEL TO CARD LAYOUT
cardDeck.setLayout(cardSelector);
//DEFINE LABEL FOR FIRST CARD
Label question = new Label("How many PAIRS of data would you like to enter?");
//BUTTON TO SUBMIT NUMBER OF POINTS TO PLOT
answerButton = new JButton("OK");
listJComboBox = new JComboBox( getArray() );//USE getArray() METHOD TO SET ITEM LIST OF THE COMBO BOX
listJComboBox.setMaximumRowCount(10); //SETS THE VISIBLE NUMBER OF ITEMS TO THE USER
Label xValues = new Label("X Values"); //LABEL FOR X values
Label yValues = new Label("Y Values"); //LABEL FOR Y values
//BUILD CARD DECK
JPanel comboBoxCard = new JPanel(); //CREATE FIRST CARD
comboBoxCard.add(question); //ADD question LABEL TO FIRST CARD
comboBoxCard.add(listJComboBox); //ADD listJComboBox TO FIRST CARD
comboBoxCard.add(answerButton); //ADD answerButton TO FIRST CARD
textFieldTopPanel = new JPanel(); //CREATE TOP PANEL OF SECOND CARD
textFieldTopPanel.add(xValues); //ADD xValues Label TO SECOND CARD
textFieldTopPanel.add(yValues); //ADD yValues Label TO SECOND CARD
textFieldBottomPanel = new JPanel(); //CREATE BOTTOM PANEL OF SECOND CARD
textFieldBottomPanel.setLayout(new FlowLayout(FlowLayout.CENTER,10,10)); //SET LAYOUT FOR BOTTOM PANEL
textFieldPanel = new JPanel(); //CREATE PANEL FOR SECOND CARD
textFieldPanel.setLayout(new BorderLayout(10, 10)); //SET LAYOUT FOR SECOND CARD
textFieldPanel.add(textFieldTopPanel, "North"); //ADD textFieldTopPanel TO NORTH
textFieldPanel.add(textFieldBottomPanel, "South"); //ADD textFieldBottomPanel TO SOUTH
cardDeck.add(comboBoxCard, "Step 1"); //ADD FIRST CARD TO DECK
cardDeck.add(textFieldPanel, "Step 2"); //ADD SECOND CARD TO DECK
container.add(cardDeck); //ADD CARD DECK TO CONTAINER
//DEFINE BUTTON HANDLER OBJECT
ButtonHandler buttonHandler = new ButtonHandler();
//ADD ACTION LISTENER FOR BUTTONS
answerButton.addActionListener(new ButtonHandler());
}//END RegressInput() CONSTRUCTOR
//METHOD TO CREATE AND RETURN AN ARRAY OF VALUES FOR JComboBox
private String[] getArray()
//CREATE ARRAY TO HOLD 30 VALUES
int numbers[] = new int[29];
//CREATE int IN ORDER TO START THE ARRAY AT 2 INSTEAD OF 1
int number = 2;
//ASSIGN VALUES FROM 2 TO 30 TO numbers[] ARRAY
for(int count=0; count < 29; ++count)
numbers[count] = number; //SETS EACH INDEX TO number
number++; //INCREMENTS number
}//END for LOOP
//CREATE pairs[] ARRAY TO HOLD 30 STRINGS
String pairs[] = new String[29];
//ASSIGN VALUES 1 TO 30 IN STRING ARRAY FOR COMBO BOX
for(int count = 0; count < 29; ++count)
pairs[count] = "" + numbers[count];
}//END for LOOP
return pairs;//RETURNS pairs[] ARRAY FOR THE LIST ITEMS IN listJComboBox
}//END getArray() METHOD8
//RETURNS THE ITEM SELECTED BY THE USER FROM THE JComboBox
private int getValue()
//ASSIGNS STRING VALUE OF THE JComboBox TO A WRAPPER
Integer v = new Integer((String) listJComboBox.getSelectedItem());
//ASSIGNS WRAPPER VALUE TO int
int value = v.intValue();
//RETURN VALUE OF SELECTED ITEM
return value;
}//END getValue()
private void setTextFields()
{//HERE LIES THE PROBLEM! WHAT GOES IN THIS METHOD????
for(int count = 0; count < (2 * getValue()); ++count)
}//END setTextFields()
//BUTTON EVENT HANDLER CLASS
private class ButtonHandler implements ActionListener
//PROCESS EVENT
public void actionPerformed(ActionEvent e)
//WHICH BUTTON CAUSED THE EVENT?
if(e.getSource() == answerButton)
cardSelector.last(cardDeck);
cardDeck.setSize(600,600);
}//END if STATEMENT
}//END actionPerformed()
}//END ButtonHandler CLASS
}//END RegressInput CLASSHere is main:
import javax.swing.JFrame;
public class TestSharpStats
public static void main(String[] args)
//DEFINE FRAME OBJECT
RegressInput window = new RegressInput("Hi"); //SETS TITLE BAR
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //CLOSES WINDOW
window.setSize(400, 600); //SET FRAME SIZE
window.setResizable(true); //PREVENTS USER FROM RESIZING WINDOW
window.setVisible(true); //SETS window TO VISIBLE
}//END main()
}//END TestSharpStats CLASSmuit-post: http://forum.java.sun.com/thread.jspa?messageID=4442652
-
Automatic fill up the text fields
Hi everyone!
I have the table with 3 columns - name&surname,birthday and the place of birthday.
Also I have drop-down list which is filled with items from name&surname column and 3 text fields which according as birthday and place of birthday columns.
So, when I will choose one item from drop-down list, I want that 3 text fields automatic will fill up with data from table.
I hope you understood me.
Thanks anyway!It is simply a case of navigating the hierarchy of the Form structure to get to the object that you want. For example if I have a form and a page on the page we have a table with rows and in the row we have a field, you would use an expression something like this:
TargetField.rawValue = form1.Page1.Table1.row[instance number].fieldname.rawValue
where instancenumber is a 0 based index of the row that you want to extract.
Hope that helps -
Professional 8 - Can't Get Rid of Tab Number In Text Field
Hello,
I hope someone can help me with this issue - when I create a text field on a PDF document and type text in the field, a "1" appears in the upper left hand corner (it's enclosed in a little black bordered box). If it was only in the PDF file itself I could deal with it, but unfortunately it shows when I print the document too. I've got some advice that it's the Tab function in Professional 8, but when I look for a way of turning it off or at least preventing it from showing up in the print, I can't find anything that works. Adobe support has been no help, there still "looking into it". I was hoping that perhaps someone has had a similar situation and could shed some light?.....
Thanks!,Hello Bernd,
I've attached an example of what's happening though I don't know if you'll be able to view the "1" in the upper left hand corner of the Text Field unless you have similar settings in Professional 8 (just a guessbecause Tech Support at Adobe couldn't see it so I sent a screen shot as well), so I've also attached a screen shot of the bottom of the document where the Text Field is showing the "1" in the corner.
Things I've tried from suggestions made:
1) You have a tab order in your form turned ON. This is a standard feature of Adobe Acrobat. This is the only way Acrobat will display little numbers in the left-hand corner of the text field. However, tab order should not be visible during printing or entering data. These numbers are only displayed while editing form fields using "Form > Edit Fields in Acrobat...." - (Which I didn't use to create the Text Field, I used "Tools", "Forms", "Text Field Tool")
2) "Print" dialog. Select "Document" under "Comments and Forms" pull-down menu to avoid printing any markup or comments.
I suspect that tab order might get printed for some reason you select anything else besides "Document". - (I've tried everything is this menu)
3) 1. Open your PDF form. -
I want to create decimal number formated text field
hi
I am trying to create decimal for eg 1234.20
only this type number can acssess
for that what I dotry adding a CustomKeyListener to your text component....
to create decimal for eg 1234.20((JTextComponent)component).addKeyListener(CustomKeyListener(4,2));
import java.awt.event.*;
import javax.swing.text.JTextComponent;
public class CustomKeyListener extends KeyAdapter {
char separator = '.';
// total digits allowed
int maximumSize ;
// digits before the separator
int before = -1;
// digits after the separator
int after = -1;
public CustomKeyListener(int the_before,int the_after) {
before = the_before;
after = the_after;
maximumSize = before+after+1;
public void keyTyped(KeyEvent e){
JTextComponent txtComp = (JTextComponent) e.getSource();
if (txtComp.getText().length() < maximumSize ){
if(Character.isDigit(e.getKeyChar())||
e.getKeyCode() == KeyEvent.VK_BACK_SPACE||
e.getKeyChar() == separator ||
e.getKeyChar() == ',') {
// if txtComp contains a separator
if (txtComp.getText().indexOf(",") != -1 ||
txtComp.getText().indexOf(".") != -1 ){
// a second separator (if typed) will be deleted
if (e.getKeyChar() == separator ||
e.getKeyChar() == ',') {
e.setKeyChar(new Character('\b'));
return;
// typed a digit
int separatorPosition;
if (txtComp.getText().indexOf(",") != -1 ){
separatorPosition =txtComp.getText().indexOf(",");
else{
separatorPosition =txtComp.getText().indexOf(".");
// finding caret position
int cp = txtComp.getCaretPosition();
// System.out.println("posizione del caret " + cp);
// caret before separator
if ( cp <= separatorPosition ){
if (txtComp.getText().
substring(0,separatorPosition).trim().length()<
before){
return;
else{
e.setKeyChar(new Character('\b'));
return;
else{
// caret after separator
if (txtComp.getText().
substring(separatorPosition+1).length()<
after){
// digit is ok!
return;
else{
e.setKeyChar(new Character('\b'));
return;
else{
// separator absent
// if is typed a separator
if (e.getKeyChar() == separator ||
e.getKeyChar() == ','){
int cp = txtComp.getCaretPosition();
if (txtComp.getText().length() - cp-1 < after){
return;
else{
e.setKeyChar(new Character('\b'));
return;
// is typed a digit
else{
if(txtComp.getText().trim().length()<before){
return;
else{
e.setKeyChar(new Character('\b'));
return;
}else{
// the key pressed isnt numeric
if (Character.getNumericValue(e.getKeyChar())!=-1)
e.setKeyChar(new Character('\b'));
return;
else{
// Maximum lenght reached
e.setKeyChar(new Character('\b'));
} -
Script to Automatically change number to text with Adobe LifeCycle Designer ES 8.2
Hi there!
I am extremely new to FormCalc and scripting and I was wondering if someone can tell me if my query is possible, if so, please help me!
I would like for each time a user enters a number in a cell for the number to change to a letter or vice versa, please see below what I am trying to achieve with this task.
Score as follows:
A; Excellent, B; Good, C
English Test
Tutor 1 score
Tutor 2 score
Speaking
A
B
Reading
C
B
Writing
C
B
Forming an argument
B
B
English Grade = (Avg. Score)
Is this at all possible? Is there another way to do this so that it is easy and the student average grades can be easily generated?All you need to do is open the PDF in Pro and extend the rights to be able to fill, save and print.
To do this open the file in Acrobat Pro, File save as> Reader extended PDF > Enable additonal features
Voila!! -
I have two fields. One dropdown menu field for employee name and one field for occupation (an text field). I would like to let a employee select his name and automatically fill in the text field with his occupation. So for example:
John---> Automatically fill in "Engineer" etc..
Thank you in advance!See Programming List and Combo fields in Acrobat and LiveCycle forms by Thom Parker.
This is not simple programing, but it follows standard JavaScript programing standards. -
Production order no is missing the Batch short text field in MSC2N T.code
Hi Guys,
I have some requirement in my project. I have maintained Batch management in my project.
When I create & release the Production order in CO01, immediately Batch number (Produciton order: Goods receipt tab) creates automatically by the system.
Also this same production order should be appeared in the Short text field in Basic data 2 tab in the transaction MSC2N.
But this production order no. is not updated automatically in the short text field in MSC2N.
Is there any standard settings available for this case?
Please help me the same.
Regards,
MohanHi Mohan,
There is no standard link between Production Order and Batch Master Record, If your client needs the production order number in Batch Master record, short text field. we need to achieve it thro user exits with the help of developers.
Thanks
Balasubramanian NSD -
How do I center a text field when input can be single or multi-line?
I'm creating a form in Adobe Acrobat Pro XI and have almost everything the way I want it. One of my last problems is trying to get a text in a text field centered. The input is sometimes a single line and sometimes multi-line. If I set it up so the multi-line entries are centered, then the single line looks off ... and vice versa. Is there any way to have the text automatically centered in the text field regardless of whether it's single or multi-line?
Unfortunately, there's no way to set up a field so that the text is guaranteed to be vertically centered in both cases. If you set it up so that rich text formatting is enabled, it's possible for a user to vertically center, but it's not something you can preconfigure so that it will remain in effect when the field is cleared. For a user to do this, with the focus set to the field they'd have to display the Properties toolbar (Ctrl+E), click the "More..." > Paragraph > Alignment > Text Middle [button]
-
Please, help with text field on form
Hello,
I am creating a form. I have a text field where the person will type a number into text field and I need it to also enter in another text field. For example, the person enters 23 into text field 12, I also need the entry of text field 12 to show up in text field 63. Is this possible? I'm VERY new to this, so a step by step response would be greatly appreciated!
Thank You!!!
DebbyThis requires a script as you have to first verify that the denominator is not blank or zero, or you'll get an invalid operation.
Something like this should work as the custom calculation script of your field:
var s1 = this.getField("Text2").valueAsString;
var s2 = this.getField("Text3").valueAsString;
if (s1!="" && s2!="" && Number(s2)!=0) event.value = Number(s1)/Number(s2);
else event.value = ""; -
How to change a list/menu to a text field when 'Other' is chosen?
Hi there. I've been trying to solve this for a week now and I have depleted all my resources, that is why I'm here. I even went to jquery but nothing works and I think I was over-complicating this way too much.
In short: I have a contact form, which have a list/menu with validation, and one of the options of that list/menu is "other". What I want is that when the user select "other" automatically change to a text field in order to let the user put his custom color. This is what I have:
<form method="post" action="process.php">
<span id="spryselect1">
<label for="colors"></label>
<select name="colors" id="colors">
<option selected="option1">Blue.</option>
<option value="option2">White</option>
<option value="option3">Red</option>
<option value="other">other</option>
</select>
<span class="selectRequiredMsg">Please select a colour.</span></span>
<input type="submit" value="Send">
</form>
I know now that the approach is to show/hide a separate textbox besides the other... well. I don't know how to implement that, I think I really need your help guys. I'm completely frustrated.
Thanks in advance.Have a look at the following
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="http://labs.adobe.com/technologies/spry/widgets/selectvalidation/SpryValidationSelect.css" rel="stylesheet">
<link href="http://labs.adobe.com/technologies/spry/widgets/textfieldvalidation/SpryValidationTextField.css" rel="stylesheet">
<style>
.hidden {display:none;}
</style>
</head>
<body>
<form action="" method="post">
<span id="spryselect1">
<label for="colors">Colours:</label>
<select name="colors" id="colors" onchange="MyOnClickHandler(this.value)">
<option value="">Please select...</option>
<option value="blue">Blue</option>
<option value="white">White</option>
<option value="red">Red</option>
<option value="other">other</option>
</select>
<span class="selectRequiredMsg">Please select a colour.</span></span><span id="sprytextfield1">
<input name="other" id="other" class="hidden" type="text">
<span class="textfieldRequiredMsg">A value is required.</span></span>
<input name="" type="submit">
</form>
<script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryDOMUtils.js"></script>
<script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryValidationSelect.js"></script>
<script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryValidationTextField.js"></script>
<script>
var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1");
var sprytextfield1;
function MyOnClickHandler(value) {
if(value =='other') { //show text field and set validation
if(!sprytextfield1){
sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
Spry.$$('input#other').removeClassName('hidden');
} else { //hide textfield and destroy validation
if(sprytextfield1 && sprytextfield1.destroy){
sprytextfield1.resetClasses();
sprytextfield1.destroy();
sprytextfield1 = null;
Spry.$$('input#other').addClassName('hidden');
return false;
</script>
</body>
</html>
Gramps -
Difficulty creating rich text fields with autoresizing text on my mac (Mavericks?)
I'm a new user so I could be making a simple error, but here goes:
I'm trying to make the text fields in a pdf form be rich text with the font autoresizing as needed, but these setting seem not to save when I do this on my new mac desktop. When I open the same file on my iPad, the field appears to have the rich text setting preserved and resizes text as necessary; this also isn't a problem on my work commuter (PC with windows)*. It's very weird; I change the option settings to allow rich text and uncheck line scrolling, then lock the changes, then try to input text and the settings appear not to have taken effect. When I reopen form editing, the old settings (multiple lines, scrolling) are checked again even though I locked it. Hopefully someone out there knows why this might be happening?
*When I email the iPad pdf file to myself and open on mac, the text seems to "autocorrect" the form field text back to multiple lines/scrolling, and looks terrible.I suppose a possible solution is if there's a way to add the text form fields in Illustrator... or if there's a way to add an invisible marker (besides adding a rule line) that Acrobat will automatically read as a text field location?
-
Creating & Moving Text Fields Causes Delays/Slowness
Maybe it's my computer, but I'm trying to create a simple PDF form using only text fields and it's very slow going. I'm adding the text fields to a 4MB PDF created in Illustrator that includes hi-res JPEG-compressed images. I need the file to be hi-res for end-user printing. The problem arrises right off the bat when I go to insert my first text field. I get the text field placed and then my curser goes to the watch, then the twirling beach ball. This lasts for about 30 seconds before I can even edit the formatting/properties. Once the program is done thinking, I go to create another text field. Sometimes this too requires 30 seconds of spinning beach ball and sometimes not. Either way, it's painfully slow as I have a couple dozen of these to add and tweak. I don't want to wait 30 seconds every time I try to tweak something. I'm running with 8 GB of RAM and while my Mac Pro is 4 years old, it has a 2 x 3 GHz Quad-Core. I'm running CS5 with Acrobat Pro.
Is there a setting I could be using that could help speed things up? It just seems strange that the computer/program has to do so much thinking after each placed text box... especially since there are no formulas/calculations being used. Unfortunately, I don't usually use Acrobat or create forms, so I'm somewhat of a novice user despite being a 20-year Adobe user.
And I suppose if the problem is the size of my original PDF created in Illustrator, can I create the form on top of a much lower res PDF and then transpose the form to the higher res version for distribution?
Thanks everyone!
AbbyI suppose a possible solution is if there's a way to add the text form fields in Illustrator... or if there's a way to add an invisible marker (besides adding a rule line) that Acrobat will automatically read as a text field location?
-
Creating new text field dynamically
Hi,
can anybody let me know how can we create new text fields dynamically in JSF.
Basically the GUI will have a button/command link ,when clicked should create a new text field and then when the user enters any value in the new text fileld the formbean should be able to capture the value.
so the user will have the choice of creating any number of text fields depending on the requirement.
is javascript the only solution for this or can we do this JSF also?
Thanks in advance.You may find this article useful then: [http://balusc.blogspot.com/2006/06/using-datatables.html]. The 'add new row' example is described here: [http://balusc.blogspot.com/2006/06/using-datatables.html#AddNewRowsToDatatable]. If it concerns only one field, just use only one column. You can for instance even use List<String> instead of a List<RowObject>.
-
Limit the amount of characters of a text field based on first digit
Hello and thanks in advance for your help!
I would like to limit the amount of characters of the text field based on the first digit of the number (the text field is only limited to a number format...no decimals, no commas).
For example, if the number begins with a 3, I would like to limit the text field to allow only ten characters. I have three scenarios but if I could get started with some code and what is the best place to add it (keystroke or validation?) I can take it from there. Thanks again for your help!!I've written this code for you that does that. Use it as the field's custom Keystroke code:
// Validate that only digits are entered
if (event.change) {
event.rc = /^\d+$/.test(event.change);
// Validate string length if it starts with 3
if (/^3/.test(AFMergeChange(event))) {
event.rc = AFMergeChange(event).length <= 10;
if (!event.rc) app.alert("If the number starts with \"3\" it may not be longer than 10 digits.",1); // optional error message
You can duplicate the second part of it for additional conditions, but keep in mind that this code won't even let you remove the first character in the field if the result is an invalid one.
For example, if you enter "234567890123456" then you can't remove the "2" at the start because that would result in an invalid number. You can remove any of the other digits, though, and when it's 10 digits or less then you could remove the starting "2" as well.
Maybe you are looking for
-
Different mapping tools in the market -- For BPM mapping in XI
Hi All I am more intersted in learning the BPM mapping tools(3rd party or any) Can any list out the different tools and which are the best ? Our company looking forward to implement XI (BPM's) with mapping tools Can any help me on
-
How to create a Worklist in BPS for Forecasting?
Hi In BPS, we are Forecasting for several company Codes. I would like to cretae a Worklist in BPS so that Users can choose a company Code for planning. I am not sure how to create this. Can some please suggest a method. I think it has to to do with
-
Do I have to use deployment tool to build my ear/jar/war ?
Hi ! I have a ear application, which is developed in JBOSS+Tomcat. I want to port this into iPlanet sp3 test drive. Do I have to use the deployment tool to generate the uid and isa xml files ? Can I edit it manually ? cause I have problem to resolve
-
Adobe PDF files dont open on E65
Hi, Please give suggestions on the above problem. 1) I am trying to open a 10 Mb file, in English, however I recieve an error. 2) Any particular settings I need to enable to view it. 3) The version I am using is a LE 1.5 which came with the phone. th
-
Hi, We would like our developments to work in the same way as standard SBO works, but we have a problem with locking. E.g. Business partner master data works in the following way: 1. I start it twice, open the same business partner in both window and