Trying to underline the rectangle of a Text Field

I am trying to underline the rectangle of a Text Field with a Line Annotation, but I am a little confused.
The first doubt is about the "Square" vs, the "Rectangle" annotations. What is the difference between them? Has Adobe changed those recently?
I have tried several variations of the following snippet:
    var x1 = textField.rect[0];
    var y1 = textField.rect[1];
    var x2 = textField.rect[2];
    var y2 = textField.rect[3];
    var underscore = this.addAnnot({
        page: 0,
        type: "Line",
        rect: [x1, y1, x2, y1],
        strokeColor: color.red,
        strokeWidth: 160
What I am getting is an identity line (i.e., 45-degree) at the lower left corner.
-Ramon

Thanks for your reply, try67:
Could you -or anybody else- please clarify this:
"The square rect defines top-left-x, top-left-y, bottom-left-x and bottom-left-y.
For a line it's left-x, left-y, right-x, right-y."
According to such definition, the square rect does not contain any information about the right side?
Maybe what you meant to write is:
"The square rect defines:
top-left-x, top-left-y, bottom-right-x and bottom-right-y.
For a line it is
left-x, left-y, right-x, right-y."
If that's the case, a rect of zero height is the same thing as a horizontal line. That was my assumption, but I am getting a 45-degree line through the origin.
TIA,
-Ramon

Similar Messages

  • I need to get the value of a text field that is located in another page JSP

    I need to get the value of a text field that is located in another page JSP. How do I do that?

    Well you see, I have a page at angelfire.com, which
    does not support JSP. I want to call a script located
    at mycgisever and then, when pressing a link on the
    former page, the JSP page is loaded, and the script
    get the value from the text field on the OTHER page.
    Is this possible?I know nothing about cgi. But that should not prevent me from understanding what can and cannot be done, assuming cgi is sort of comparable with jsps.
    I'm unable to understand your description clearly. Try to explain it better. Give precise steps that you intend to follow and I should be able to help you further.
    So you have a page1.
    You hit submit from page1.
    That goes to the cgiserver.
    From the cgiserver, programmatically load up the jsp.
    search this for the text field.
    Display it on your page2.
    Is that what you are trying to do?
    BTW, won't be able to help you with cgi scripting at all. Can help with Java and Jsp.

  • Changing the background of a text field in adobe interactive forms

    Hello All,
    Is there any way to change the background colour of text field in interactive form dynamically.??
    Thanks,

    Naresh,
    Change the language to JavaScipt in Script Editor of LiveCycle Designer and use the following code to highlight the area of TextField where R,G,B means that you have to give the RGB values of the color you want.
    <YourTextFieldName>.border.edge.color.value = "R,G,B";
    For eg:- If you have a textfield with name TextField1 then this will highlight the TextField1 area in red color.
    if ((TextField1.rawValue==null) || (TextField1.rawValue==""))
      TextField1.border.edge.color.value = "255,0,0";
    You can use this on exit event of Textfield1 or at the submit button where you check the form data.
    Chintan

  • Dynamically change the size of a text field.

    Is it possible to change the size of a text field depending on the amount of text in the field?
    Thanks,
    Chad

    You can find the answer from this post.
    jimmypham, ""Shrink to Fit" - Text Field capability?" #1, 18 Jul 2005 10:36 pm

  • Setting the focus to a text field on a subform in the form initialize event.

    I have a form that checks the rawValue of a text field to determine whether or not the focus should be set on a particular text field. Here is the logic:
    if(txtEmailVisible.rawValue == "visible")
    frmEmailData.presence = "visible";
    xfa.host.setFocus(xfa.form.NEDA.main.frmEmailData.txtEmailBody);
    else
    frmEmailData.presence = "hidden";
    For some reason the focus isn't going to that object, instead it is still going to the first field in the tabbing order. Am I calling this in the wrong event, which is causing the tabbing order to over ride my setFocus call?
    Thanks,
    Chad

    Try using setTimeout for this from the DocReady event.
    app.setTimeout("xfa.host.setFocus(xfa.form.NEDA.main.frmEmailData.txtEmailBody);
    ", 250);
    There are several occasions where code must be executed after init/formReady/DocReady, etc. has been completed. This is one of them.

  • Change the background of a text field when a checkbox is checked?

    Hi,
    I'm new to Adobe JS, having done some browser scripting previously.
    I'm making a form in which I would like to change the background of a text field to bright yellow (RGB code 220,220,0) when a corresponding checkbox is checked?
    I have a checkbox named chkCD56, with an option value set to 1.
    I have a text field named CD56 with a transparent background.
    Can someone help me with the JS code?
    Thanks.

    Hi
    To make your number filed in Red :
    Right click on the field and go in format field click on Font tab and go in Color formula editor and give the following formula :
    If Sum(fieldValue} < 0 Then CrRed else CrNoColor
    Now go in Style formula editor and give the following :
    if sum() < 0 then Critalic
    This will make your field red and italic when it is less than 0
    Thanks,
    Sastry

  • Trying to set the contents of a Text View in Objective-C

    Hi there,
    I have a properly linked up Text View (within a Scroll View) in Interface Builder, and I wish to change the value of that Text View at runtime.
    I am trying this code here, but it (and other similarities of it) is not working;
    [textField setObjectValue:@"Hello there user"];
    //or
    [textField setStringValue:@"Hello there user"];
    //or
    [textField setObjectValue:myString];
    When run, my app crashes and the console returns me with something like this;
    {quote}
    2008-04-12 11:23:43.040 Application Bugging Message Test[2251:10b] * -[NSScrollView setObjectValue:]: unrecognized selector sent to instance 0x12a490
    2008-04-12 11:23:43.041 Application Bugging Message Test[2251:10b] An uncaught exception was raised
    2008-04-12 11:23:43.041 Application Bugging Message Test[2251:10b] * -[NSScrollView setObjectValue:]: unrecognized selector sent to instance 0x12a490
    2008-04-12 11:23:43.041 Application Bugging Message Test[2251:10b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSScrollView setObjectValue:]: unrecognized selector sent to instance 0x12a490'
    2008-04-12 11:23:43.042 Application Bugging Message Test[2251:10b] Stack: (
    2460484171,
    2484588795,
    2460513354,
    2460506700,
    2460506898,
    7997,
    2460543573,
    2524339906,
    2524299500,
    2524297805,
    2524296848,
    2524296654
    {quote}
    I have also tried changing the bindings in Interface Builder, but they make no difference, whether I link the Text View (which I think I should link to) or to the Scroll View.
    Any help would be greatly appreciated.
    Ricky.

    Of course!
    I am always getting mixed up when to use the prefixes - in this case;
    [textField getStringValue:variable1];
    Thanks for reminding me
    Ricky.

  • Trying to find the prefs for importing text (retainFormat)

    In my (model only) plugin wich only deals with custom data link, I'm trying to find the last chosen user preference for things like 'retainFormat' for importing files.
    What I want is my plugin to do exactly the same as when a text file is dragged from the desktop, but then from my own source.
    Everything works just fine, except for the options in 'IImportManagerOptions'.
    I can't figure out a way to get to these. Is that only available for UI plugins?
    Anyone?
    thanks!

    Thanks Bartek!
    I already looked at that code but didn't get it to work. Messed something up with headers and then jumped to the wrong conclusions...
    Now it works
    Thanks again!

  • Underlining a digit in jFormatted Text Field

    Let me rephrase a question a I asked yesterday now that I've learned more..
    I want to allow the user to click on a digit in a FormattedTextField and have that digit underlined. (buttons then inc or dec the digit value). I tried changing the default Caret to do this. It does create an underline, but I realize now when you click in the field it finds the closest space between characters, not the closest character. So the cursor will go to different places if you click on the right verses the left half of a digit. Can I modify this behavoir or should I be using something else?
    I am new at Java, so I could be missing something very basic.

    Using my example code above I overrode the following method of the DefaultCaret and it seems to work:
    * Tries to set the position of the caret from
    * the coordinates of a mouse event, using viewToModel().
    * @param e the mouse event
    protected void positionCaret(MouseEvent e)
         JTextComponent component = (JTextComponent)e.getComponent();
         Point pt = new Point(e.getX(), e.getY());
         Position.Bias[] biasRet = new Position.Bias[1];
         int pos = component.getUI().viewToModel(component, pt, biasRet);
         try
              Rectangle view = component.modelToView( pos );
              if (view.x > e.getX())
                   pos--;
                   view = component.modelToView( pos );
              MouseEvent me = new MouseEvent(
                   e.getComponent(),
                   e.getID(),
                   e.getWhen(),
                   e.getModifiers(),
                   view.x,
                   e.getY(),
                   e.getClickCount(),
                   e.isPopupTrigger());
              super.positionCaret( me );
         catch(Exception ble)
              super.positionCaret( e );
    }The code is based on your concept of comparing the proposed caret position with the mouse clicked position. When the caret position is greater than the mouse we move the caret back one position.

  • How to calculate the size of a Text Field?

    Is there a way to calculate the number of characters allow in a Text Field? If a uer type over this number of characters a popup window will appear telling the user that he/she has too much texts. Of course I could use the Limit Length, but I have to manually put texts into this text field and count them. If the Limit Lenth number is too small, the texts does not fill the whole text field. If the number is too big then the texts does not get printed.

    There would be no easy way to do this. You'd need to do some pretty fancy calculations, it would all depend on the size of the field, what font is used, the font size, whether it's been bolded, underlined, italicized, etc etc.
    What are you trying to accomplish? Make it so that the user can type in the text field until it fills and then have it stop without scroll bars coming up to allow him to keep typing?
    Chris
    Adobe Enterprise Developer Support

  • How can I change the content of a text field in a PDF form with a defined variable?

    Hello all!
    First time poster, and getting pretty frustrated with trying to figure out this one issue. Here is the scenario: I am using Acrobat 10 Pro to design what is essentially a giant order form. I designed the document in InDesign, defined the various buttons and whatnot and then exported it to Acrobat to continue building the form.
    I have a Radio Button group called "conference_opportunities" which contains different options at different price points, so they are all named the same, but have different values (so that they belong to the same group and only one can be selected at a time).
    What I have done is created a "MouseDown" event on the radio button that sets a variable called "ConferenceOpportunity" which is equal to the title of the option they are picking. I then want to take that variable and display it in a text box called "Conference_Option". I am using a variable because the values of my radio buttons are all the actual prices of the option they are picking, so I can't define the value as the title of the option.
    So its an array of radio buttons, and at the bottom of the page there is the Option They Selected, the quantity (which can change) and the value (in dollars)
    I also then want to display this variable at the end of the document as a sort of summary of everything they chose to purchase as well but I imagine its the same code.
    I am not an expert Javascript person at all, so any code snippets would help greatly. I have looked over the Adobe Document on the SDK and API and have not been able to find a solution. I have also turned to the almighty google and still no luck.
    Any help would be greatly appreciated!
    Thanks Everyone

    All you now have to do is use that variable to the value property of your text field... So add this at the end of your code:
    this.getField("Conference_Option").value = ConferenceOpportunity;
    Also, I would use MouseUp, not MouseDown.

  • Sum the values of a text field in a tabular form using JavaScript

    Hi Folks.
    OK, I put my hands up. I don't know Java script but I'm picking up the basics and I WANT to learn.
    Here's my situation.
    I have a tabular form which has lots of Standard Report Columns and ONE text field.
    I want to sum the values entered in the text field, real time, using Java Script without the need to have a round trip to the database.
    I'm guessing this will involve some kind of loop. Once I have that SUM figure I will store it in a hidden item and it will be used for validation when the user submits the form.
    If anyone can give me a simple Java Script to do this, or point me in the direction of one, I'd be very grateful.
    Many thanks.
    Dogfighter.

    Hi Arie.
    Thanks for the link.
    That's a great start,
    What I've got working so far is the following...
    <script type="text/javascript">
    function f_calculate_delta(p_this,p_rownum)
    var amt = $x(p_this).value;
    alert (amt);
    var display_item_to_set = 'f08_'+ p_rownum
    $x(display_item_to_set).innerHTML = amt
    </script>
    This is working fine.
    Where I'm stuck at the moment is how I can 'get' the value of another cell in the same row. They have all been set up using the APEX_ITEM API with their own unique IDs.
    I will continue looking but if you could give me a steer, that would be great.
    Many thanks
    Simon
    PS. APEX 3.1
    PPS. Trying to get the value of another row using...
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $x(display_item_to_get).value
    PPPS. Also tried...
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $v(display_item_to_get)
    and
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $v(display_item_to_get).value
    None of which are working at the moment.
    Message was edited by:
    Dogfighter

  • While i am trying to save the existing record with same fields in cloud DTO using flex4 mxml app

    hi,
    i am doing flex4 web application with mxml tags,
    i  am having one text box and one datagrid and one save button. text box  having one company name, data grid having employee names.
    when i click save button which is placed in outside the datagrid it will save all the details in cloud DTO.
    Now  my requirement is text box having the same company name and when i  enter same employee name in datagrid and click save button means it wont
    allow to save that record, and through msg box with some alerts.
    this is my code:
    private function saveRecord():void
                 refreshRecords();
                 model.employeeDetailsReq=new EMPLOYEEDETAILS_DTO();
                     var lengthindex:uint=model.employeeDetailsReqRecordsList.length;
                     var i:int;
                     for (i = 0; i < lengthindex; i++)
                     if((model.employeeDetailsReqRecordsList.getItemAt(lengthindex).employee name==customerdet.selectedItem.employeename)&&
                          (model.employeeDetailsReqRecordsList.getItemAt(lengthindex).employeeNumber==customerdet.s electedItem.employeeID)){
                         Alert.show("you cannot Add Same CustomerName and Invoiceno again");
    (when this line come the error through like this: Index '8' specified is out of bounds.
    else
    var dp:Object=employeedet.dataProvider;             
    var cursor:IViewCursor=dp.createCursor();
    var employeename:String = employeename.text;
             model.employeeDetailsReq.employename = employeename;
    model.employeeDetailsReq.employeeNumber=cursor.current.employeeID;
    var sendRecordToLocID:QuickBaseEventStoreRecord = new
                         QuickBaseEventStoreRecord(model.employeeDetailsReq, new
                             KingussieEventCallBack(refreshList))
                     sendRecordToLocID.dispatch();
    <mx:Button  id="btnAdd" x="33" y="419" enabled="false" label="Add" width="65"  fontFamily="Georgia" fontSize="12" click="saveRecord()"/>
    employeename and employeeID are datafields of datagrid. datagrid id=customerdet
    employeeDetailsReqRecordsList---recordlist of save records
    please help .
    any suggession or snippet code welcome
    B.venkatesan

    sorry but you question  is not very  clear...are you trying to show the item clicked on the datagrid on the input box? with an alert? you should look at "listevent" if thats the case?... sorry i just dont follow.
    Miguel

  • Clear the content of a text field

    hello guys,
    i have text fields in a screen which are been populated in the PBO. Now i want to clear the content of the  text field such that the user can input new values in those text field.
    so, anyone knows how i can achieve this.
    tried,
    text field name = ' ', space.
    clear text field name.
    but none worked.
    thanks you for ur help.

    Hi,
    I think you have doen some thing like this in PBO.
    screen_field_name = 'some value'.
    So now in PAI you can do the following.
    CASE sy-ucomm.
         WHEN 'F_CLEAR'.    " Fcode for the clear button in the screen.
          CLEAR : field_name.
      ENDCASE.
    If the field is a mandatory field then you need to create a AT EXIT module and write the same code in that.
    Hope it helps you.
    Thanks,
    Sri.

  • Retaining the cursor on a Text Field when error on the field

    Hi,
    We have a requirement, where when we tab out of a text field, the data entered gets validated and exceptions are caught using array list and then thrown on top of the page.
    However, we have a requirement, that on tab out, the cursor should remain in the same field in case there are errors thrown on that field otherwise should move to the next field.
    My Approach is
    1) Capture the tabout event in PFR.
    2) If the validation returns erorr messages, do a forwardImmediately to CurrentPage
    3) Set the focus in PR and throw the exception.
    I read the discussion on the link How to set focus on a textinput/poplist using PPR
    and tried the same approach but below are my observations.
    Approach - 1) WITH FIRE PARTIAL ACTION on text field.
    Input = Invalid, then error message is thrown and I am not able to see the cursor.
    Input =  Valid  , then I see the cursor in the next text field, which is correct.
    Approach - 2) WITH FIRE ACTION
    Input = Invalid, then error message is thrown, the text in the textfield looks selected, which is the required functionality.
    Input =  Valid, then still I see the same text as selected. Here I dont want the text to be selected and want the cursor to move to the next field. This is not happening.
    Please let me know where exactly I am committing the mistake.
    Thanks
    Saurabh
    Edited by: SaurabhAg on Jan 25, 2012 5:53 AM
    Edited by: SaurabhAg on Jan 25, 2012 6:06 AM
    Edited by: SaurabhAg on Jan 25, 2012 6:44 AM

    Can someone please reply to this. Its urgent.
    Thanks
    Saurabh

Maybe you are looking for