How to add bullet on every enter event in text field
Hello, Can someone please point me in the right direction. I am trying to add a bullet every time someone presses enter on the keyboard. this is within a textfield.
Thank you,
Howard
Hi
I would solve it by a script that checks your multiline field for newlines by ENTER key and insert "* " in the beginning of each line.
1) create a multiline field in your form
2) insert the script below in exit event... and enjoy the magic ;)
just 7 lines of code without comments. The split function is very powerful, I really use it alot now!
===== script start =====
//value of the field to insert "* " in each line
var sFldValue = this.rawValue;
//you split text in field for each '\r' = newLines made with enter
var tmpFldArray = sFldValue.split("\r");
//tmp string you concat your out text in
var sOutStr = "";
//for each line of text insert '* ' in beginning
for(var i = 0; i < tmpFldArray.length; i++){
//need to add '\r' because split removed it
sOutStr += "* " + tmpFldArray[i] + "\r";
//return manipulated string to your field
this.rawValue = sOutStr;
===== script end =====
/Thomas Groenbaek
Jyske Bank
Denmark
Similar Messages
-
How Can i send the data entered in Input text fields to e-mail?
Iam Jennifer, Iam having a doubt in Flash, I hope that you
are going to solve my problem, Iam taking 3 Static text fields as
Name, Age and Country and besides each and every static text fields
i have taken 3 input text fields with different instance names,
when i enter my Name, Age and Country details in the input text
fields and after entering those details if user clicks the submit
button the data should be send to some mail address, is it possible
Im not so good at action script, but i hope that any one can
help me...
Iam attaching the action script code also, please find the
attachment below, the actions are given to button.
Attach Code
Btn.onPress = function ()
mail_lv = new LoadVars();
mail_lv.dummy1 = "";
mail_lv.subject = "Details";
mail_lv.message = "hi";
mail_lv.username = "name_txt".text;
mail_lv.age = "age_txt".text;
mail_lv.country = "country_txt".text;
mail_lv.onLoad = function ()
trace("Sent successfully...");
trace("mail_lv.subject = " + mail_lv.subject);
trace("mail_lv.message = " + mail_lv.message);
mail_lv.send("mailto:[email protected]", "_blank");The names of your variables, "name_txt", for instance, should
NOT have quotes around them. Use:
mail_lv.username = name_txt.text;
mail_lv.age = age_txt.text;
mail_lv.country = country_txt.text; -
How to submit page by hitting "enter" in a text field - Solution
Hi,
I had this problem yesterday and thought it may come in handy for others who run into the same issue.
My page had 2 text fields. Upon hitting enter in either of the boxes I wanted the page to submit. When only 1 text field was present it worked, however once the second field was added this stopped working.
After reading a bit (http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.html) I fount that "When there is only one single-line text input field in a form, the user agent should accept Enter in that field as a request to submit the form.". This would explain why it worked with only 1 field, but not with 2.
After doing some testing I found that to make it work with 2 or more text fields, I needed to add a submit button. This is not the same as a button in APEX. In APEX "button" just has a onClick call to a submit function. You need a native HTML submit button.
In order to do that I created text field. Deleted the label, and set the static value to "Search" (this was for my search application). In the page attributes I added the following:
< script language="JavaScript1.1" type="text/javascript">
document.getElementById("P1_SEARCH_SUBMIT").type="submit";
< / script >
Note: I added extra spaces in the tags so they would display properly.
This function changes the button type to submit.
Now when I have 2 or more text forms it submits when I hit enter in either one.
MartinHi,
Set the Source Used: Only when current value in session state is null in Edit Page Item.
Regards,
Kartik Patel
http://patelkartik.blogspot.com/
http://apex.oracle.com/pls/apex/f?p=9904351712:1 -
How to add a SPACE as suffix to the last field in the downloaded text file?
Hi Experts,
By using GUI_DOWNLOAD am saving the data(only 3 fields) in a text file on my desk top.
fine.
example current record1 : 010001 354.999 26.000
here, after 3rd field 26.000, immediately the cursor is jumping to next line in text file.
but, wanna a SINGLE SPACE after 26.000, say 26.000+space.
tried with CONCATENATE, OFFSETTING, but no use(may b am using incorrectly)
so, pls. suggect me, How to add a SPACE as suffix to the last field in the downloaded text file?
thanqSorry...Typo error...Too many in the last few days -:(
Wanted to say AFTER -:)
Do it like this...
FIELD1 TYPE XXX,
FIELD2 TYPE XXX,
FIELD3 TYPE XXX,
SPACE(1) TYPE C,
That way you should end with...
26.000+SPACE
Greetings,
Blag. -
ADD ITEMS TO DROPDOWN BOX FROM A TEXT FIELD(USER ENTERS THE ITEM) AND BOUND VALUE ALSO
I WANT TO ADD ITEMS THE DROPDOWN BOX FROM THE TEXT FIELD(ITEM NAME) WHERE USER ENTER'S THE ITEM DESCRIPTION
AND BOUND VALUE ALSO SHOULD BE ADDED TO THE SAME ITEM.
SAME WAY REMOVE ITEMS FROM DROPDOWN BOX
PLEASE GIVE SAMPLE FORM OR JAVASCRIPT FOR THE ABOVE SCENARIO.....
INDEED HELPFUL FOR MY PROJECT PLEASE SEND ATTACHED PDF FORMHi Praveen,
Your form is not shared so I have not been able to access it. But I have updated mine. There are now two approaches, one that follows on from the above method and updates each drop down list in each row. The second updates a separate dataset that the drop down list is bound to. This second approach requires the remerge() method which can cause problems if your code has updates some form properties like a borders color as these will be reset, but the code is simplier and you will only have one list to maintain. The add button click code is;
var particulars = xfa.datasets.resolveNode("particulars");
if (particulars === null)
particulars = xfa.datasets.createNode("dataGroup","particulars");
xfa.datasets.nodes.append(particulars);
var particular = xfa.datasets.createNode("dataValue","particular");
particular.value = ItemName.rawValue;
var boundValue = xfa.datasets.createNode("dataValue","id");
boundValue.value = BoundValue.rawValue;
particular.nodes.append(boundValue);
boundValue.contains = "metaData";
// find sorted position to insert
for (var i = 0; i < particulars.nodes.length; i++)
p = particulars.nodes.item(i);
if (p.value > particular.value)
particulars.nodes.insert(particular, p);
break;
// add to end if greater than all existing items
if (particular.parent === null)
particulars.nodes.append(particular);
// clear source fields
ItemName.rawValue = null;
BoundValue.rawValue = null;
// remerge form data to pick up new item
xfa.form.remerge();
And the binding looks like;
I have updated my sample to include both methods, https://workspaces.acrobat.com/?d=OwysfJa-Q3HhPtFlgRb62g
Regards
Bruce -
Every time show a text Field, I want to show a letter "M"
next to this text file
like
|------------------|
| | M
|------------------|
I alredy have a class who extends TextField, but I don't know how to insert
the graphic next to the TextField????
Thank you for any help.Every time show a text Field, I want to show aletter M or a graphic
"M"
next to this text file
like
/pre
|------------------|
| | M
|------------------|
pre/
I alredy have a class who extends TextField, but I
don't know how to insert
the graphic next to the TextField????
Thank you for any help. -
How to give error message for the screen element text field when wrong i/p
How to give error message for the screen element text field when wrong i/p
when wrong input given
eg.
I have a text box with SBOOK-CARRID
so when user give wrong entry in text box i.e LG
then I should give some error stating that the the input is invalid or not available ,
now it showing the error of standard messages,
i want manual message to be displayed when error comes.
Thank you,
Regards,
Jagrut Bharatkumar ShuklaHi all,
Thank you for your valuable reply,
but the thing is that its a screen field,
i.e text box not a selection screen
i created in screen layout
with name sbook-carrid
now i want to get error message display if wrong i/p is given
thank you.
Regards,
Jagrut bharatkumar Shukla, -
How to add a check if entered number is even
hi!
I need some help. I need user to enter the size of the figure to be printed out. It has to ba an even number (otherwise it will print out with error). I need to add a check if entered size is an even number, otherwise display an error message and prompt user for entering the size again. If it is an even number the program should proceed and print out a figure. Any suggestions for the piece of code I need to add? Many thanks in advance!
import java.util.*;
public class Question2 {
public int Size;
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.print("Please enter the size of a triangle you want to print out (it has to be an even number): ");
int Size = keyboard.nextInt();{
if (Size%2==0){
line(Size);
drawtop(Size);
middleline(Size);
drawbtm(Size);
line(Size);
public static void line(int Size) {
System.out.print("|");
for (int i = 1; i <= Size / 2; i++) {
System.out.print("-");
System.out.print("*");
for (int i = 1; i <= Size / 2; i++) {
System.out.print("-");
System.out.print("|");
System.out.println(" ");
public static void drawtop(int Size) {
for (int line = 1; line <= Size / 2; line++) {
System.out.print("|");
for (int space = 1; space <= Size / 2 - line; space++) {
System.out.print(" ");
for (int star = 1; star <= (line * 2 + 1); star++) {
System.out.print("*");
for (int space = 1; space <= Size / 2 - line; space++) {
System.out.print(" ");
System.out.println("|");
public static void middleline(int Size) {
System.out.print("*");
for (int i = 1; i <= Size / 2; i++) {
System.out.print("**");
System.out.println("**");
public static void drawbtm(int Size) {
for (int line = 1; line <= Size / 2; line++) {
System.out.print("|");
for (int space = 1; space <= line - 1; space++) {
System.out.print(" ");
for (int star = -1; star <= (2 * Size / 2 - 2 * line) + 1; star++) {
System.out.print("*");
for (int space = 1; space <= line - 1; space++) {
System.out.print(" ");
System.out.println("|");
}Its really unbelievable that if you have written the code of printing triangles by yourself, how you got stuck at a trivial problem like this. Please just dont copy and paste the code for completing your assignments.
Anyway the solution is trivial and I am giving you a work-through-:
Think what the if condition is doing in the below code :
if (Size%2==0){
} It does nothing.
You need a condition in which to print a message to ask user to input an even number and ask again if the number is not even. Doesnt this look like that u need a loop, And you dont know the how many times to loop but you do know when to end the loop. SO you need a WHILE loop with appropriate condition checked of even number.
Now I hope you can complete the program. -
Hi Experts, oo hierarchical alv, how to add checkbox on every header?
Hi Experts,
I am working on oo hierarchical alv, how can I add checkbox on every header? thanks in advance!
Kind regards
DawsonHi Dawson,
Just refer the below program & pass the check box functionality (mentioned in bold) in REUSE_ALV_HIERSEQ_LIST_DISPLAY in your program.
TYPE-POOLS : slis.
Data
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE t001.
DATA : flag tyPE c,
END OF itab.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvly TYPE slis_layout_alv.
Select Data
SELECT * FROM t001 INTO TABLE itab.
*------- Field Catalogue
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB'
i_inclname = sy-repid
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
Display
alvly-box_fieldname = 'FLAG'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
i_callback_program = sy-repid "<-------Important
i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
is_layout = alvly
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
CALL BACK FORM
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
LOOP AT itab.
itab-flag = 'X'.
MODIFY itab.
ENDLOOP.
IMPORTANT.
WHATROW-REFRESH = 'X'.
ENDFORM. "ITAB_user_command
Regards
Abhii... -
How to add a dollar sign $ to a formatted currency field
Any idea how to add a $ sign to a formatted field?
Hi Kim,
Right click on the field and click on Format Field.
In the !Format event type: $@_$_.
This should place a $ before your output value.
James. -
How to restrict user to must enter value in compulsory fields
Greetings !
I had a personal information form. I want to restrict user to enter values in all fields e.g Compulsory fields (Username, D.O.B etc)
how i restrict user to must enter value in Compulsory fieldsI created an example on apex.oracle.com
http://apex.oracle.com/pls/apex/f?p=18686:1:0:::::
like you see a red staric placed on ID it means it is complusory to enter because it is a primary key, i want this on every field or to restrict user to enter all data , if any field left blank it will give error "to Fill respective field ", but not on creation but on left blank (if user type ID e.g 12 and skip ename field and go on Job field it gives error to fill Ename first) -
How to add the Match code object for the requisitioner field in TCODE ME51N
Hi,
How to add the search help (Match code object) for the requisitioner field in transaction ME51N.
Please do the needful to me.
Regards
Rajeshdon't you think that posting your question to a microsoft developer site would be more efficient?
regards,
anton -
How do you add a scroll bar to a scrolling text field in a folio?
I've created iPhone and iPad folios with multiple pages. There are scrolling text fields on each page. The fields scroll as designed, but the scroll bars on the text fields only appear while actually scrolling. Is there a way to have them always visible so the user knows there is more hidden info? The only bars that are constantly visible are the page scroll bars. Thanks!
Why is your content pane null? I thought the content pane was the top-level in all windows? If you want complete control over the location of a list box, you want to set the layout of the content pane to null... the way I almost always do this is the other way around, to create my own panel and use setContentPane instead:
JPanel content = new JPanel(null);
JScrollPane scroll = new JScrollPane(myListBox);
scroll.setBounds(380, 10, 500, 500);
content.add(scroll);
setContentPane(content); -
How to restrict Date field entered in a text field should be of MM/dd/yyyy
Hi,
I have an text field for Date entry,the Date format is MM/dd/yyyy,while entering the value i want to verify wether the values entered are valid or not,like month should n't be more than 12,date value depends on month should not exceed 30,31 or 28,year should not exceed 9999 like,if not possible at the time of entery i want to stop at least before submission.Right now i am traing to use my own model which extends PlainDocument calss,
as in the fallowing way.But i t could not stop me to enter the wrong values ,Any help would be appreciated.
mport javax.swing.text.PlainDocument;
import javax.swing.text.AttributeSet;
import javax.swing.text.Document;
import javax.swing.text.BadLocationException;
import java.awt.Toolkit;
* Insert the type's description here.
* Creation date: (11/26/2001 6:22:14 PM)
* @author: Administrator
class DateFormatDocument extends javax.swing.text.PlainDocument {
* DateFormatDocument constructor comment.
String sInputMask; DateFormatDocument(){
// sInputMask="MM/dd/yyyy";
sInputMask="09/30/2000";
try{
// insertString(0,"MM/dd/yyyy",null);
insertString(0,"09/30/2000",null);
}catch(BadLocationException ex){System.err.println(ex);}
public void insertString(int offs,String str,AttributeSet a) throws BadLocationException{
String sText=super.getText(0,getLength());
if(sText.length()==0)
super.insertString(offs,str,a);
return;
int len=str.length();
String sText1 = super.getText(0,2);String sText2 = super.getText(3,5);String sText3 = super.getText(6,10);
int str1=Integer.parseInt(sText1);int str2=Integer.parseInt(sText2);int str3=Integer.parseInt(sText3);
// System.out.println("str1:"+str1);
if(offs<2 && str1<=12){
if(len<=2){
super.remove(offs,len);
super.insertString(offs,str,a);
else if(offs==2){
super.remove(offs,1);
super.insertString(offs,"/",a);
else if(offs<5 && str2<=30){
if(len<=2){
super.remove(offs,len);
super.insertString(offs,str,a);
else if(offs==5)
super.remove(offs,1);
super.insertString(offs,"/",a);
else if(offs<10 && str3<=9999 ){
if(len<=4){
super.remove(offs,len);
super.insertString(offs,str,a);
else{
System.err.println("Beep!");
//Toolkit.beep();
public void remove(int offs,int len) throws BadLocationException{
System.err.println(offs + " " + len);
if(offs<2){
if(len==1){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(len==2){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(offs==2){
//do nothing
else if(offs<5){
if(len==1){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(len==2){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(offs<10){
if(len==1){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(len==2){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(len==3){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(len==4){
super.remove(offs,len);
super.insertString(offs," ",null);
}<code>
mport javax.swing.text.PlainDocument;
import javax.swing.text.AttributeSet;
import javax.swing.text.Document;
import javax.swing.text.BadLocationException;
import java.awt.Toolkit;
* Insert the type's description here.
* Creation date: (11/26/2001 6:22:14 PM)
* @author: Administrator
class DateFormatDocument extends javax.swing.text.PlainDocument {
* DateFormatDocument constructor comment.
String sInputMask; DateFormatDocument(){
// sInputMask="MM/dd/yyyy";
sInputMask="09/30/2000";
try{
// insertString(0,"MM/dd/yyyy",null);
insertString(0,"09/30/2000",null);
}catch(BadLocationException ex){System.err.println(ex);}
public void insertString(int offs,String str,AttributeSet a) throws BadLocationException{
String sText=super.getText(0,getLength());
if(sText.length()==0)
super.insertString(offs,str,a);
return;
int len=str.length();
String sText1 = super.getText(0,2);String sText2 = super.getText(3,5);String sText3 = super.getText(6,10);
int str1=Integer.parseInt(sText1);int str2=Integer.parseInt(sText2);int str3=Integer.parseInt(sText3);
// System.out.println("str1:"+str1);
if(offs<2 && str1<=12){
if(len<=2){
super.remove(offs,len);
super.insertString(offs,str,a);
else if(offs==2){
super.remove(offs,1);
super.insertString(offs,"/",a);
else if(offs<5 && str2<=30){
if(len<=2){
super.remove(offs,len);
super.insertString(offs,str,a);
else if(offs==5)
super.remove(offs,1);
super.insertString(offs,"/",a);
else if(offs<10 && str3<=9999 ){
if(len<=4){
super.remove(offs,len);
super.insertString(offs,str,a);
else{
System.err.println("Beep!");
//Toolkit.beep();
public void remove(int offs,int len) throws BadLocationException{
System.err.println(offs + " " + len);
if(offs<2){
if(len==1){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(len==2){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(offs==2){
//do nothing
else if(offs<5){
if(len==1){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(len==2){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(offs<10){
if(len==1){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(len==2){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(len==3){
super.remove(offs,len);
super.insertString(offs," ",null);
else if(len==4){
super.remove(offs,len);
super.insertString(offs," ",null);
</code> -
Adobe LiveCycle Designer 8 - Add days to Current Date in another text field
Hi-
I am working on an expense report. I have six fields, CurrentDate, and countDate1 through countDate5. The CurrentDate is a Time/Date field which the user can select whatever date is needed with the drop down calendar. The other five countDate fields are "text" fields which will represent Monday through Friday. I would like to add zero days to whatever the user selects as the CurrentDate and make that appear in countDate1 which represents Monday(the CurrentDate the user selects will always be a Monday), add one day to whatever the user selects as the CurrentDate and make that appear in countDate2 which represents Tuesday...and so on. I realize this is probably basic for someone familiar with FormCalc but I'm very new at this.
This got me very close but I want the user to select the date and not have the CurrentDate already filled in.
CurrentDate - DateTime field, FormCalc calculation script:
num2date(Date())
Date1 - Text field, FormCalc calculation script:
Num2Date( Date2Num(CurrentDate.formattedValue))
Date2 - Text field, FormCalc calculation script:
Num2Date( Date2Num(CurrentDate.formattedValue) + 1 )
Thanks!
BrianHere is an exmaple of adding days the script is used in the "exit" event for the date select field that has display format of "MM/DD/YYYY". Adding days requires add x number of days to the days since the epoch date for the current date, adding months or years one needs to manipulate the string parts of the date.
----- form1.#subform[0].InputDateField::exit: - (FormCalc, client) ---------------------------------
// fomatted string for selected date
var sFmtDateValue = $.formattedValue
var sMsg = Concat("Entered date formatted: ", sFmtDateValue) // build message string
sMsg = Concat(sMsg, "\u000a" ) // add new line to message
// convert date string to days since epoch date - format is important
var fDaysPast = Date2Num(sFmtDateValue, "MM/DD/YYYY")
// add 7 days to days past epoch date
var f7DaysPlus = fDaysPast + 7 // add 7 days
var s7DaysPlus = Num2Date(f7DaysPlus, "MMM DD, YYYY") // format string for 7 days plus
sMsg = Concat(sMsg, "\u000a", "Plus 7 Days: ", s7DaysPlus) // build message string
// add 14 days to days past epoch date
var f14DaysPlus = fDaysPast + 14 // add 7 days
var s14DaysPlus = Num2Date(f14DaysPlus, "MMMM DD, YYYY") // format string for 7 days plus
sMsg = Concat(sMsg, "\u000a", "Plus 14 Days: ", s14DaysPlus) // build message string
// display results
// work on months
// get parts of date past epoch date
var sFullYear = Num2Date(fDaysPast, "YYYY") // get 4 digit year form days past epoch date
var sMonth = Num2Date(fDaysPast, "MM") // get month form days past epoch date as number
var sDate = Num2Date(fDaysPast, "DD") // get date form days past epoch date as a number
var s2Month = Sum(sMonth, 2) // add 2 months
var s2FullYear = sFullYear
// if more than 12 months in new date adjust year on number of months
if (s2Month > "12") then
s2FullYear = Sum(s2FullYear, + 1) // increment year
s2Month = Sum(s2Month, - 12) // adjsut months
endif
var s2MonthsAdded = Concat(s2Month, "/", sDate, "/", s2FullYear) // date string
sMsg = Concat(sMsg, "\u000a", "Added 2 months: ", s2MonthsAdded) // display stringxfa.host.messageBox(sMsg, "Sample Adding Days" ,3, 0);
var s5Month = Sum(sMonth, 5) // add 5 months
var s5FullYear = sFullYear
// if more than 12 months in new date adjust year on number of months
if (s5Month > "12") then
s5FullYear = Sum(s5FullYear, + 1) // increment year
s5Month = Sum(s5Month, - 12) // adjsut months
endif
var s5MonthsAdded = Concat(s5Month, "/", sDate, "/", s5FullYear) //build Date string
sMsg = Concat(sMsg, "\u000a", "Added 5 months: ", s5MonthsAdded) // display stringxfa.host.messageBox(sMsg, "Sample Adding Days" ,3, 0);
// display results
xfa.host.messageBox(sMsg, "Sample Adding Days and Months" ,3, 0);
Maybe you are looking for
-
Access denied when trying to use PDF printer as normal user
I have Acrobat 8 professional installed on a computer running Windows XP SP3. When i try to print a document to pdf from any program as Administrator it performs just fine. When i log on as a normal, restricted, user i get the window popup asking for
-
IDoc TO File: Receiver Determination did not find any receivers at all
Hi, We have IDoc to file scenario, where based on attributes present in IDoc we have configured different receivers. Everything was working fine and files were getting created based on the receiver determination criteria. But there is one change done
-
How to get the current date using HTMLB JSP page
Hi All, I developed an iview with several fields using PDK, I would like to know how can I include for a date field a dynamic value witch in this case is the current date. <hbj:inputField id="Date" type="date" maxlength="10" showHelp="TRUE" required=
-
Printer preferences in 10.6?
My paper size as set in system preferences doesn't display correctly in the print window. I need to delete the printer preferences file and start again. Where is the printer preferences file in 10.6?
-
Call a class after successfuly starting weblogic server
I need to create a class which which some parameter and start a application automatically just after starting weblogic server so that when user request for application he will get quick response. Actually my application takes some time to be start se