Looking to use a check box to set value of a text field

I have 2 address fields 1 for billing and 1 for shipping I put a check box in to determine if the shipping address is the same.  Keeping it simple just want the shipping address to check if the box is checked and if it is copy the information in the billing so they are the same and if it is not checked to leave it blank
any help with this would be appreciated.

I think I have it 90%there. I have no error now, it edits a
record fine, if you add the checkbox to the record it adds it, and
if you take it away, it does that. BUT now it will not add a new
record.
This is my code now for the update / insert
<cfif not IsDefined("FORM.admin")>
<cfset IsAdmin= 0>
<cfelse>
<cfset IsAdmin= 1>
</cfif>
<cfif isDefined("Form.RecordID")>
<cfquery datasource="#APPLICATION.dataSource#">
UPDATE user
SET user.Fname=<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.Fname#">,
user.Lname=<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.Lname#">,
user.userName=<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.userName#">,
user.password=<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.password#">,
user.email=<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.email#">,
user.admin =<cfqueryparam value="#IsAdmin#"
CFSQLType="CF_SQL_INTEGER">
WHERE ID =<cfqueryparam value="#form.RecordID#"
cfsqlType="CF_SQL_INTEGER">
</cfquery>
<cflocation url="indexUser.cfm?RecordID=#Form.RecordID#"
addtoken="no">
<cfelse>
<cfquery result="GetNewRecord"
datasource="#APPLICATION.dataSource#" dbtype="ODBC">
INSERT INTO user
(Fname, Lname, userName, password, email, admin)
VALUES (<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.Fname#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.Lname#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.userName#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.password#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.email#">,
<cfqueryparam value="#IsAdmin#"
CFSQLType="CF_SQL_INTEGER">)
</cfquery>
<cflocation url="indexUser.cfm">
</cfif>
Is there a better way to write this so it will work? I have
everything else working including the checkbox showing checked if
it is checked in the db, I believe this is my last hang up on a
checkbox.
Any ideas?

Similar Messages

  • Need Help: I need a check box to auto fill a set value in separate text field.

    Hi, this is my first time with inserting scripts into a PDF Form.
    We have a form that requires the user to check a box regarding medical conditions they have (i.e. Asthma, Diabetes, Hypertension).  Later in the form, they have to type out the same condition into a text box. (I know stupid to double document, but it is required).  Is there a script that will auto fill the text box when they check the box?  For example, if they check asthma, the text box on a later page in the PDF will say "Asthma, controlled."  Is this possible?
    In addition, if they don't click Asthma, and do click Diabetes, could it add Diabetes to the first text box, but if they check both, it would add Asthma to box 1 and Diabetes to box 2?
    Any help would be GREATLY appreciated.
    I'm using Acrobat 9
    Thanks!

    Hi, I'm staring at the code trying to make it work for my needs, which are similar to Austin's.
    I have a 16-page form with 2,988 checkboxes in the entire document (a little over 200 in each page besides the first and last page). The last page contains a textbox labled Summary, and it should provide a summary of all the items checked in the document. Theoretically only one page will be populated at a time, so there will be no more than 200 checkboxes checked in the entire document.
    Is it possible to use the same code? And do I just put the code under the text in the script that reads:
    form1.SummaryPage.SummaryText::calculate - (JavaScript, client)
    The JS I am trying to get to work is the following from a post above.
    // Custom Calculate script
    (function () {
        var i, v, s = "";
        // Loop through the 2988 check boxes
        for (i = 1; i < 2989; i += 1) {
            // Get the value of the current checkbox
            v = getField("checkbox " + i).valueAsString;
            // Concatenate check box value to string if not deselected
            if (v !== "Off") s+= v + "\r";
        // Set this field value
        event.value = s;

  • If I use a check box component then FScommand2 Quit does not work

    If I use a check box component then FScommand2 Quit does not
    work? Even tho the check box component works fine.
    Why is this so? I spent two hours tearing my hair out to work
    this out!

    I have tried to help my friend Blasta and then he export the photo (as you told us to do)  the description is lost. Then I have read your god advices I took up one photo in Graphic Converter with result:
    ---- ExifTool ----
    ExifTool Version Number: 9.39
    ---- System ----
    File Name: DSC00160.jpg
    Directory: /Users/akesjodin/Documents/Jan 2
    File Size: 594 kB
    File Modification Date/Time: 2013:12:17 13:46:16+01:00
    File Access Date/Time: 2013:12:17 13:51:37+01:00
    File Inode Change Date/Time: 2013:12:17 13:48:05+01:00
    File Permissions:
    rw-r--r--
    ---- File ----
    File Type: JPEG
    MIME Type: image/jpeg
    Current IPTC Digest: fac9fec98a44c4d807be572ed64373d6
    Exif Byte Order: Big-endian (Motorola, MM)
    Image Width: 3328
    Image Height: 2216
    Encoding Process: Baseline DCT, Huffman coding
    Bits Per Sample: 8
    Color Components: 3
    Y Cb Cr Sub Sampling: YCbCr4:2:0 (2 2)
    ---- JFIF ----
    JFIF Version: 1.01
    Resolution Unit: inches
    X Resolution: 72
    Y Resolution: 72
    ---- IPTC ----
    Coded Character Set: UTF8
    Application Record Version: 2
    Caption-Abstract: Alla bilder Gepe Made in Sweden (41 stycken) utom 17 stycken Agfacolor Service German Made, 1 stycken Agfacolor Dia Agfa, 15 stycken Kodachrome Slide Kodak Processed by Kodak, 5 stycken Kodachrome Transparency Processed by Kodak och 1 stycken okänd...Bergastrand. X. 1970. Blandade bilder. .(Somm?)ar 1970 1 magasin..Torsten Erna 1 magasin..Blandade bilder 710-749...Bergastrand...Vänstra magasinet: Bergastrand 1 år I...12-68. 701.
    Object Name: DSC00160
    and there is the description text in Caption-Abstract under ----IPTC---
    If I use Preview I can´t se any descrption and if I import to Iphoto no descption.
    we are very greatful for all help

  • My daugther' iphone id under my wife's email and now all music and pictures are attached to that id.  Wife now has an ipad and looking at using the existing id for set up? Would like to establish new id for daughter and not lose or share music/photos?

    My daugther' iphone apple id is under my wife's email and now all music and pictures are attached to that id.  My wife now has an ipad and I am looking at using the existing id during set up?   Thus, I would like to establish new apple id for daughter, associated to her email account, however I do not want to lose or share her music/photos, nor share with my wife's id.  Is this possible, or is it best just to establish a new id for my wife, and then change the email address associated with the existing apple id?

    well if you establish a new apple id for your wife that would be best unless you email all of the existing photos to your email and then when you have established a new id then you log into your email on the new id and save all of your pics onto it by pressing on tthe pic for about 5-8 seconds then options will come up and you press the save to my album ..as for the music if you can copy and paste, through computer, the songs then awesome!

  • How to use Multiple Check Box control  to make a list of items in check box

    I have a use case where i have to save update list of items required, and i want to implement it through viewobject and use Multiple check box control, how do i go about it? Code snippet will be helpful........
    Edited by: jDev_08 on Nov 17, 2012 8:31 PM

    Hi,
    Always mention your JDev version.
    Check out the ADF Faces Demo : http://jdevadf.oracle.com/adf-richclient-demo/faces/components/index.jspx#%2Fcomponents%2FselectManyCheckbox.jspx (Hint : Code snippet is available in there itself).
    -Arun

  • Help with creating a form, I want to add a check box to enable me to unlock certain fields and deselect the block again

    Help with creating a form, I want to add a check box to enable me to unlock certain fields and deselect the block again

    Look to the right under "More Like This". Your issue has been discussed many many times. The error you are seeing is because you do not have enough free "contiguous" space on your hard drive. Read the other threads that address this issue to find how to solve the issue.
    Or, put "The disk cannot be partitioned because some files cannot be moved" into the search box at the upper right of this page.

  • Setting values for non-displayed fields on a Tabular Form

    I'm having a problem setting non-displayed fields on the same table as displayed fields like last_update_date, last_updated_by, id's and other fields when creating new records or updating existing records in a Tabular form.
    What is the best and easiest way to set these values without using database triggers?

    Hi Jes,
    I'm a little reluctant to use database triggers as I used this product a couple of years ago and I'm fairly sure I handled this problem in HTML DB without the use of triggers. I am therefore I'm getting a touch frustrated that I can't remember how to do it now !!
    Do you know of any way of setting values for non-displayed fields on a Tabular Form without using database triggers?
    Also, you seem to be suggesting that database triggers is the best way to do this?
    Thanks

  • Invalid text value. A text field contains invalid data. Check the value and try again

    Hello,
    I am having a problem with the error mentioned in the title. I see alot of others have experienced the same problem, but I have quite a twist to it.
    I see the problem when I try to edit a list item, and then try to save the changes.
    Here what I see in the ULS log:
    System.Runtime.InteropServices.COMException: Invalid text value. A text field contains invalid data. Check the value and try again  
    at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId,
    Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter
    pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback)   
    at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean
    bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback,
    ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback)
    I have 3 front end servers(fx wfe1, wfe2, wfe3).  And here is the twist.
    If I access the library directly through wfe1 and wfe2, I get the error. If I access the library via wfe3 if works just fine.
    So because of this, I think it is safe to assume that is has nothing to do with the character limit of 255. Nor does it have anything to do with the field type, since it is already set to mulitible lines of text.
    So. Any ideas?
    Regards,
    Michael
    mic

    Check if there is any change in web.config of these servers
    http://support.microsoft.com/kb/2880758
    To work around this issue, limit the length of the personal message in the invitation to 256 characters or less.
    This is a known issue. Microsoft is working to resolve this issue.
    http://social.msdn.microsoft.com/Forums/en-US/7bb16e51-e7cc-439e-a8b3-755683ccac1a/max-length-on-custom-field-types
    To solve the problem you may have to change the field's parent type to "note". To do that you have to open your fldtypes... file under Templates/xml and change the line to:
    "<Field Name="ParentType">Note</Field>" from "<Field Name="ParentType">Text</Field>"
    You might also have to add a sql type if your text needs to be longer than 255 characters
    <Field Name=”SQLType”>ntext</Field>
    and inherit from SPFieldMultiLineText instead of SPFieldText
    If this helped you resolve your issue, please mark it Answered

  • How to use a check box in ALV

    Hi All,
    I have a urgent requirement in my <b>ALV list</b>.
    Where in the output list i need to create a check box, which is followed by Sales order, quantity columns etc......
    Requirement:  1. tell me how to <b>create</b> a <b>check box</b>
    2.   i need to select the checkbox(Sales Order) and press  a push button which is above the list(push button) in the tool bar.
    I am able to see the output using  <b>reuse_alv_grid_display</b>.
    <b>But kindly let me know how to <b>link</b> the <b>check box</b> and the <b>push button</b> which is above the list for further processing.</b>
    Possibly a sample code will help a lot.
    Thanks in advance.
    Rajesh Kumar.

    TO create a check box, take one field in your internal table as:
    CHK TYPE C.
    Now, pass the LAYOUT by filling up the LAYOUT strucutre.
    LAYOUT-BOX_FIELDNAME = 'CHK' .
    This will provide you the BOX field in the GRID and Checkbox in the LIST.
    When you select the  checkbox the field value will set to 'X' in the table.
    Regards,
    Naimesh Patel

  • Using a check box to enable/disable buttons.

    I am just beginning to dive into the world of mobile application development, and encountered the first time I think I need to use a function (<mx:Script... private function) and was wondering how I would go about making it so when a specific check box is selected, a set of corresponding buttons are enabled. When it is unselected, these buttons are then disabled. I'm sure this is a super novice question, so I'm hoping someone out there can help. This is for an iOS mobile app. Thanks!

    Thanks for your response.
    Based on your reply, I've entered this -
    if (this.rawValue == 1){
    Company1.rawValue = Company2.rawValue;
    Contact1.rawValue = Contact2.rawValue;
    Phone1.rawValue = Phone2.rawValue;
    Email1.rawValue = Email2.rawValue;
    Address1-1.rawValue = Address2-1.rawValue;
    Address1-2.rawValue = Address2-2.rawValue;
    Address1-3.rawValue = Address2-3.rawValue;
    City1.rawValue = City2.rawValue;
    ZipCode1.rawValue = ZipCode2.rawValue;
    Country1.rawValue = Country2.rawValue;
    and when I clcik the check box in the Preview PDF pane, nothing happens.
    Do I have to save this as a "reader enabled" file before I can check to see if it works?  Our clients that receive this form will be filling it out using Adobe Reader.
    I'm only focused on the first two columns for now.  I may eventually add the "End User" column down the line, but I just want to get the first part working first.
    Company1 corresponds to the binding value in the "Company" field in the first column (Invoice or Bill To).  Company2 corresponds to the binding value in the "Company" field in the "Ship To (from freight forwarder)" in the second column.  This is the same pattern all the way through.
    In the address fields, the binding values are shown as as follows -
    Address1-1 means column 1, field 1
    Address1-2 means column 1, field 2
    Addrress1-3 means column 1, field 3
    Etc...
    I think I need to change the binding value for each field as I don't think the script like the "dash" in the binding values of the address fields.
    Again, I'm sorry for these are stupid questions, but I am completely uneducated and green when it comes to using scripts.

  • How to use a check box in smart forms????

    Hi All,
    Pls let me know how to use check boxes in smartforms.....??
    there are check boxe available which are crossed (i.e,, selected checkboxes) in the smartforms..
    But i need a checkbox which are not selected.( i.e.., which are not crossed).
    Its really urgent...
    Quick responses are highly appreciable..
    Bye

    Refer this thread
    Re: how to display symbols in smartforms
    We can create symbols in smartforms. For this, change the editor to text editor and then goto insert->characters->SAP Symbols and select the symbol you want.
    You cannot see the symbols in print preview, it'll appear only on a hard copy.
    You can also create as Text Element. In the left side of the right window,you can see a icon called Editor.Click it.
    Then in the Menu,
    go to->Change Editor
    Then in the menu,
    Insert->Characters->Displayable characters,select the character you want.Otherwise,if you want to insert SAP Icon,select that option instead of Displayable Character.

  • How to use the check box?

    How is the check box to be used? If I have 10,000 songs in my itunes library and have 1,000 of them checked, how can I place all 1,000 checked songs into a new playlist that I have created just for them. They are not located together in my library so I can't just hold down the SHIFT key and highlight them all for movement. Also, I would rather not have to hold down the CONTROL key and then search through 10,000 songs for the 1,000 I have checked. So what is the secret to accomplishing this?
    Can you sort your library by whether a songs is checked or not? If I could sort them all together as a group, then I could use the SHIFT key to highlight and move them all.
    Am I missing something here? How can you select and sort songs by whether they are checked or not in your library?
    Thanks so much for any help you can provide.

    If only the 1,000 songs you want are currently checked, create a Smart Playlist to collect them.
    How to Create a Smart Playlist
    - File=>New Smart Playlist
    - Playlist is 'whatever playlist you want to use'
    - Match only checked songs
    Note: There is no way to select the Main Library. If you're working with the Library as a base, you'll need un-check the 'Match the following rule' and check 'Limit to' and put a high enough number to capture all the songs.
    Several ways to creatively manage the issue.
    You may wish to create a Static Playlist once you are done, and drag those songs into it for more permanence.
    Post back if you have more questions.

  • How do can I have the form fill in a check box if the user has entered text in a textbox?

    I have a form that is submitting an xml data file that is picked up by MS Word and used to populate a document. However, there's a 'Miscellaneous' field where the user can type in addtional information that would not drop easily into the Word document (exceptions, items not on the drop down lists, etc.). I'd like to test to see if that Miscellaneous field has infomation in it and if it does, to set a invisible checkbox to "1" so that I can insert a text message in the Word document that there's additional information in the .pdf form that will have to be addressed manually in the Word document.
    I've tried
    if(Misc.rawValue !== "")
    otherinfo.rawValue = 1;
    but while it doesn't generate a Javascript error, it doesn't set the value either, and I haven't found any function that checks for whether a field is empty. I'm sure there's got to be a way to do this, but I'm stumped. Any help greatly appreciated!
    Bill

    It appears you are using LiveCycle Designer, so you will have to use the syntax of FormCalc or LiveCycle Designer JavaScript.
    For FormCalc:
    if(HasValue(Misc)) then
    otherinfo = 1
    else
    otherinfo = 0
    endif
    For JavaScript
    if(HasValue(Misc.rawValue))
    otherinfo.rawValue = 1;
    else
    otherinfo.rawValue = 0;
    I added code to clear the check box if the user clears the field.

  • Using radio buttons to set the value of a text field

    I have a set of three radio buttons on a form (a performance evaluation). If I select the "1" button, I want 1 to populate in the text field. The same goes for "2" and "3"
    I have not been able to code the buttons correctly for this scenario, and can't figure out how to do it.
    From a previous post, I was able to get check boxes to do what I want, but they won't really work because I can't set them so that only one back may be selected.
    Can this be done?
    Thanks!

    The information for this specific case isn't anywhere. The best that you can do is understand what triggers each of the events, then ask yourself which of those triggers are pertinent to your current issue.
    http://help.adobe.com/en_US/livecycle/es/LiveCycle_Designer_Scripting_Basics.pdf ...
    The above link contains a great deal of information regarding how to use scripts within Livecycle Designer. The section that you would be most interested in in order to learn about the available events can be found under "Events >> List of Events".
    You needed to use the initialize event so that the text field would be updated when the document was opened. This ensure that the text field has the value of the default radio button when it is opened for the first time.
    You needed to use the change event so that, when the use selects a different radio button, the text field is updated with the new value.
    That's about it. That PDF file that I link to above is a bit long, but it's a great place to get a good grasp of the basics of scripts.
    If you have any further questions, feel free to ask. =) Have a good one.
    - Scott

  • Is it possible to get a check box's export value when it is OFF

    Hi,
    I'm wondering if I can set a check box export value to something like "S".
    I'll want to check all boxes whose export value is "S", but I want to detect if the export value is "S" when the box is NOT checked. Is that possible?
    Thanks in advance.

    Another option is to use COUNTIF for the column of checkboxes.
    =COUNTIF(B2:B9, TRUE)*3.75
    Any of the cells between B2 and B9 with a checkbox will be included in the count of people that paid the 3.75 amount. It does of course assume that the amount received is always 3.75.
    Erik

Maybe you are looking for

  • Transferring music from Iphone to a new installed Itunes library

    I have recently had my lap top repaired and my Itunes has had to be erased, I have reinstalled Itunes and my Itunis es music library is now empty and I did not make a back up, is there anyway I can transfer all the music from Iphone back in to my mus

  • TOOLBAR QUESTION...PROBABLY NOT THAT IMPORTANT...

    I've noticed in all the tutorials, that the toolbar has four differently colored circles.  These do not appear on mine.  Believe me, this is the LEAST of my problems with CS5, but just curious. Kathi

  • User rights: only reading

    hello. I'd like to create a user with only reading rights, on all a server. How to create that user, because I didn't see nothing in the useradd command options? Thank you

  • Can't Connect to Other Mac

    I have 2 macs in my house... a mac mini (pre intel) and a macbook... I've always had them networked so I could access files on either computer.. all of a sudden, I can't connect to the mini... all the settings are the same in the sharing folder... bu

  • Crash while deleting photos results in inconsistent database

    Hi, I deleted about 200 photos while regularly emptying the trash bin. Suddenly iPhoto closed itself. After restarting iPhoto (Version 6) all the previously deleted photos appear in the photo archive thumbnail preview as empty frames. The "real" phot