Prefill a text box from a selection of the option button

Hi people,

I just noticed an error in one of my first attempts at Javascript - luckily I don't think that one of my colleagues have noticed yet, but I need to fix it as soon as possible!

I have two radio buttons naned "Radio Button13". One is for when the person is full time and one for when they are part-time. When the full time button is selected, I get text (that I placed in the value of the button) to fill out in advance a text box below. The text is something like "38 hours per week. Part-time has nothing.

In the Mouse Up script for full-time, I placed:

If (this.getField("Yes").value is "1")

= this.getField("Working_Hours").value ' 08:30 to 17:00 Monday to Friday " < < < this text is same not the same as the value of the button so I don't know why I put that here, this is not what I want in the text box.

The text of the button value is reflected in the area of text (called "working time") very well, but the idea is that when part-time work is selected, the user is able to enter the hours in the area. You can type, but as soon as you leave the text box, the text disappears.

Where am I wrong? How can I solve this problem?

It is not wrong, but it answers my question. If you keep things put in place what they are now, you can use the following custom calculate script:

(function () {}

Get a reference to the Group of radio buttons

and its value

var f = getField ("Radio Button13");

v var = f.valueAsString;

Allow the user to enter text

Event.Target.ReadOnly = false;

Located only value in this field if a change in the option box

is what triggered this script

If (event.source & event.source = f) {}

Si (v ! == « Off » && v ! == "«) {}

Event.Target.ReadOnly = true;

Event.Value = v;

} else {}

Event.Value = "";

}

}

})();

Tags: Acrobat

Similar Questions

  • Auto insert some text in a text box, via a selection of the option button

    Hi all

    I'm quite new to work with Adobe Acrobat Pro DC, in fact, I'm new to working with Adobe period. I also took on the task to work to turn a fillable bunch of Word documents as pdf documents on the screen. Through tutorials online, trial & error and videos YouTube, I became accustomed to some of the basics for the preparation and editing of pdf documents.

    What I find much more difficult is where the tutorials on how java script commands is added to a form. Is there somewhere I can learn how to add JavaScript for, say, a radio button? I can locate the "execute a JavaScript script" tab Radio button Properties Action but in the past, it is not a lot out there.

    My ultimate desire is to be able to have a line of automatic text to insert in a text (results of the APC) box after selecting the radio (WI_0) button. If someone could write the code for this, it would be very appreciated, but above all that, I'd love to learn how JavaScript is used in a form.

    Thank you for your time,

    BobbyD

    OK, in this case you can use the MouseUp event of the fields radio button with this code:

    If (event.target.value == "in spec") this.getField("APC_Results").value = "see attached results;

  • Pulling data from a selection of the option button to use in the field

    I have a radio with 9 options button (1 000, 2 000, 3 000... 9 000). It's a form of insurance, and I can't change to a drop down or fill-in, etc..  I need a later field in the form to the number they chose in the option box.  For example, if some select 3rd in the series of radio (3,000) button I want Field2 fill-in auto number 3 000.

    Is it possible to do an if / then statement to extract data from the radio button option?  I could do this in Excel but don't have a clue how to do here.  And I don't know about Java.  :-(

    Any help would be appreciated!

    Carol

    You can try this custom script that another user here suggested to me

    You click on properties > Calculate > custom calculation Script > change

    Then paste this in...

    var v = this.getField("Name_of_Radio_button_grouping").value;

    If (v == "1000") event.value = "1000";

    else if (v == "2000") event.value = "2000";

    else if (v == "3000") event.value = "3000";

    else if (v == "4000") event.value = "4000";

    else if (v == "5000") event.value = "5000";

    else if (v == "6000") event.value = "6000";

    else if (v == "7000") event.value = "7000".

    else if (v == "8000") event.value = "8000".

    else if (v == "9000") event.value = "9000".

    etc.

    else event.value = "";

  • y at - it a keyboard shortcut for go to the first text box on a page when the focus is on the address bar?

    I can use Alt + D to reach the address bar to enter a URL, but is there a way I can then go to the default text box, to enter data, once the search engine page was opened, using a shortcut key? I have the commands in the shortcut keys page doesn't recognize as not being what I want.

    Not as far as I know. Sites may assign a keyboard shortcut to a text field if they like, known as an AccessKey, but he is not necessarily going to be any consistency, and the site you may not be using one.

    It is possible, there could be an add-on or userscript to help with this. Or otherwise, someone might be able to write one for a particular site.

  • My students use the filling and the signature on a package of .pdf tool I'm going to fill them, but when they record and open the next day their text boxes, that they created with the bucket fill tool and sign all went and many are overlapping.

    My students use the filling and the signature on a package of .pdf tool I'm going to fill them, but when they record and open the next day their text boxes, that they created with the bucket fill tool and sign all went and many are overlapping.

    Hi chbradshaw,

    Instead of filling & signature, tool, use the text comment comment tool, KB doc option. using comments in the PDF, Adobe Acrobat DC files (keyword: Add a text comment).

    Kind regards

    Nicos

  • I just updated my indesign to CC of CS5. One thing I notice which is annoying is some text boxes and images go live. For example, if you close a text box in CS5 you close the box you see reformat the text to set the new size. In the tex CC

    I just updated my indesign to CC of CS5. One thing I notice which is annoying is some text boxes and images go live. For example, if you close a text box in CS5 you close the box you see reformat the text to set the new size. In CC, the text does not reformat until you are done change the size of the box. It's the same for the images when resizing or rotation re. You don't know what you have until its finished. If you are a little guess instead of see what you're doing while. Is there a way to change this, or does anyone else have this problem. Maybe it's just what does CC. But I'm not a fan... Can anyone help?

    When using the image processing manages, click... for a while... then drag...

  • JavaScript form validation (stop form submit prior to the selection of the option chosen)

    I check that a "month" has been selected in the options field in a form, which works ok (code below)

    < script type = "text/javascript" >

    <!--

    function checkDayUpdate() {}

    var dm = document.forms.dayUpdate.dayMonth.value;

    inform the customer to select a month to view

    If (dm == null | dm == "Select Month")

    {

    Alert ("Please select a month to view");

    Returns false;

    }

    } / / end of function

    ->

    < /script >

    BUT as soon as I click on the 'OK' prompt in the JavaScript "alert box" in to go back and pick a month I get immediately redirected to the page in the field of 'action' forms until I have a chance to select the month.

    < form name = "dayUpdate" method = "post" action = "updateDays.php" onsubmit ="checkDayUpdate ()" > "

    How can I prevent that from happening?

    See you soon

    Operating system

    You don't say how you trigger the function. Assuming you are using the onsubmit as opening event:

    onsubmit = "return checkDayUpdate()".

    Note that you must return the result of the function, not just run it.

  • publish a report based on the selection of the radio button.

    Hello

    Any1 can help me on the below scenario?

    I have a dashboard command prompt that contains criteria below.

    Date of beginning of end and two boxes button (A, B) - what are created using 'variable prompt' and there are two reports (Report_A, Report_B).
    Cond1: Report_A should open if I select the option button "A".
    Cond2: Report_B should open if I select the option button 'B '.

    Thanks in advance!

    Hello

    keep report_A in separate section and Report_B in a separate section and apply condition of the article on him passing the variable presentation. so when the user select an option then only Report_A button is displayed.

    Follow this link to reach the requirement.

    http://Shahin-OBIEE.blogspot.in/2012/04/switching-between-multiple-reports-in.html

    Select this option if useful/correct.

    Thank you

  • When I create a button "submit" text "Submit" does not appear on the actual button.

    When I create a button "submit" text "Submit" does not appear on the actual button. Anyone know what is the problem?

    Depends on how you file the form. In Acrobat, it has a property to set the appearance of the button. In AA 8, field properties appear as below:

    It may vary in other versions (I on other machines), but the basic idea is the same. Need to add the label.

  • Question about text boxes, and then select options in web sites and text in yahoo.

    Hello

      I am a web developer working on with web sites. I am a regular user of fire fox , previously i sent an issue about search option in fire fox browser,  i am very much happy to see change in the search option in browser recently. Presently i got an issue in browser about select and text box ... i'm not able to view them properly i mean the text is breaking ... sample i opened yahoo browser .. i was shocked to see breakable text .i will attach screen shot if possible. please fix this as soon as possible.
    

    Thank you
    Lady Sarah.

    You can not attach a screenshot in the first row who starts a thread, but you can do it in subsequent responses.

    • Use a type of compressed as PNG or JPG image to save the screenshot
    • Make sure you do not exceed the maximum size of 1 MB

    What the font is used to display this text?
    You can select "Inspect element" in the context menu to open the Inspector (Firefox/tools > Web Developer).
    You can check the font used for the text selected in the tab fonts in the right pane of the Inspector.

  • Auto-fill text box values field based on the selection of the menu drop-down

    Try to fill in address, city, province, zip from text fields based on the selected option in a select form field. The following code works fine in Internet Explorer, but in Chrome or Firefox, after selection, text, the fields are filled with the word "undefined."

    I found a PHP script Jquery here version that would probabably do the trick.
    http://StackOverflow.com/questions/3657127/jQuery-populate-text-input-from-table-based-on-select-Valeur

    Maybe someone has a version of CF. they could share?

    Thanks in advance to anyone who can point me to a solution for this code, or a better way to fulfill my need.

    <!--> destinations with address auto-fill, city, etc.
    < script type = "text/javascript" >
    function selectAddress (list) {}
    take the first element is empty
    If (list.selectedIndex > 0) {}
    var locationID = list.options [list.selectedIndex] .value;
    locationAddress var = list.options [list.selectedIndex] .locationAddress;
    var locationCity = list.options [list.selectedIndex] .locationCity;
    var locationState = list.options [list.selectedIndex] .locationState;
    var locationZip = list.options [list.selectedIndex] .locationZip;
    document.getElementById('locationID').value = locationID;
    document.getElementById('locationAddress').value = locationAddress;
    document.getElementById('locationCity').value = locationCity;
    document.getElementById('locationState').value = locationState;
    document.getElementById('locationZip').value = locationZip;
    }
    }
    < /script >
    < b >
    < td align = 'right' bgcolor = "#FFFFFF" valign = "top" > Destination name < table >
    < td align = "left" bgcolor = "#FFFFFF" valign = "top" >
    < select name = "locationID" onChange = "selectAddress (this)" class = "smallforms" > "
    < option value = "" > SELECT the DESTINATION ››› < / option >
    < cfoutput query = "allLocations" >
    "" < option value = "" #locationName # "locationAddress =" #allLocations.locationAddress # "locationCity =" "#allLocations.locationCity #" locationState = "#allLocations.locationState #" locationZip = "#allLocations.locationZip #" > #locationName # < / option >
    < / cfoutput >
    < / select >

    Others: cfinput name = "destinationNameOther" type = "text" class = "smallforms" size = "75" >
    < br / >
    < input id = "locationID" name = "locationID" type = "hidden" > < br >

    Address: < input class = "smallforms" id = "locationAddress" name = "locationAddress" type = "text" size = "30" >
    City: < input class = "smallforms" id = "locationCity" name = "locationCity" type = "text" size = "20" >
    State: < input class = "smallforms" id = "locationState" name = "locationState" type = "text" size = "2" >
    Postal code: < input class = "smallforms" id = "locationZip" name = "locationZip" type = "text" size = "8" > < br / >
    < br / >
    < table > < /tr >

    In your last code done selectAddress refers to "index" but I'm not declared or assigned. I think that you are missing 'var index = list.selectedIndex;' statement.

  • by dragging the boxes from one page to the other in tabs

    I like the tabbed pages feature because it keeps my own office while working, but I can't seem to drag boxes of pictures/text from one page to another when they are tabulated.

    Often, I need to do this to make pages with similar designs/style sheets/photos can I just draw a box from one document to another, etc... is there a way to do this in the tabs?

    Thank you!

    No, you can't do that.

    But why not just copy and paste.

    There is a very useful command called 'Paste in Place' under the Edit menu.

    You can copy a selection, then use CTRL TAB or CMD-TAB to move between windows, then paste in Place (CTRL (CMD) ALT (OPTION) SHIFT V)

    It is much faster as drag / drop objects

  • Why can I send someone a text Message from my iPhone, but the iPad

    Can send a text message from my i5s, but cannot send the same person a message from my iPad. No, I want to send text uses android. In the past, I have sent this person a message from the iPad but won't work now.  What is happening with this?

    The devices must be connected on the same Apple ID, Bluetooth must be on, and then you can activate Message Forwarding text on the iPhone. It's in settings > Messages and then you will follow the steps to select the iPad. Once you do this, you will be able to send an SMS from iPad.

  • Empty text box value when reading about the LV2012 development system but no Production

    Development platform: 32-bit Windows 7, LV2012 Professional Development System.

    Production of platforms: Windows XP.

    We have a test application, we have developed (in haste, I might add) who has a curious problem.  As part of the installation for each test, read us a text box with a serial number entry and record them in the log files.  Series enough.

    This works very well on production machines - no apparent problem.

    However, on the development computer, when I try to read the text box, all I get is an empty string.  I tried to read directly from the Terminal, as well as using a property value box.  Each time, there is nothing in the string.  This is even though I'm looking at the text box and there are visible data in it.

    Clear the text box repeatedly, I'm looking to see if any of those that occur at the wrong time.  And, indeed, I am looking a probe value of ' ' from the property node Value with the string "1234" visible in the text box while NONE of the compensation functions have been affected.

    The test application uses a pretty standard user interface event loop model, with an event loop manages the user input and the other event loop manages the business logic.

    Anyone have any idea what can cause this, or a better search string to find clues?

    Thank you

    Geoff

    As promised, I did go to the bottom of it.

    Simply enable "update of value while typing" gave me the result I expected.

    To explain: I had a key event down to the first text box that has been copied to this text box.  Whenever a key was hit in this text box, the value would be read and updated.  I did not have all the events for the new text box.  It has not been updated to what some other events.  At that time, it was apparently too late (most of the time on the development computer) and occasionally on the Production machine.

    Activation of the "Update value while typing" indicator means that the value field would properly up-to-date each time he has been seen/accessible.

    Life is a learning experience...

  • How can I curve a paragraph or text box in illustrator without deforming the police?

    Hey guys,.

    I have a project where I try to add the paragraphs of the text to flow around a form of bean. The form is divided into 16 sections and each section has a single paragraph of text that must follow its own section of the curve. I don't want any deformation or distortion of the text and so far, the only solution I know is to manually create and lines of text link which is a lot of work compared to just power curve a set text box. Is this possible?

    Thanks in advance!

    Carlytext-block-curve.jpg

    Which can be simplified.

    When you are finished with the paths, select all, and then type > threaded text > do

Maybe you are looking for

  • Pavilion a1710n impossible to enter the BIOS from the put in new hard drive

    I have a HP Pavilion a1710n desktop initially under Vista Home Premium.  Problem is hard disk came out, I then replaced with a hard drive Western Digital SATA of similar type.  However, now I am unable to enter BIOS using F10 or Escape or by pressing

  • ThinkPad Z575. How can I get an upgrade?

    I got the Z575 used, and the former owner says he has Windows 7 on it and 'improved' it Windows 8. I don't know if he did himself or if it was a tachometer or whatever. I need to return the unit to W7. Please give me an idea about the options that I

  • How can I stop my iPad mini to expire

    Mini iPad times out after about 3-4 mins like more time Thank you for your help

  • DAQmx PCI 6733 too slow

    Hi all I have a PCI6733 OR. You will find attached files, the snapshot of the vi and the two-channel oscilloscope: channel 1 = device sends a signal via PFI1 in order to trigger (start and pauyse) a triangle AO = channel 2. the exposure time of the c

  • Political security G510 keeps me to install win7

    Hello I bought an a G510 because freeDOS version always had my version of 6 bits Win7 around teacher with I got from my University. The problem is that I have no idea how I should be able to install because the CD does not start in a matter of securi