Text box not empty conditional statement

I've been asked to develop a survey and, in several places, a
score is given for the completion of text box. However, if there is
no text in the box, then a score of zero should be given.
I thought the best way to do this would be to use a hidden
field with a conditional statement saying "if text box is not empty
then score=4, else score=0.
However, firstly I'm not sure how to write this and secondly,
how do you check if a text box is empty?
I think it really calls for some human input but the client
is quite sure this is how he wants it.
The scores are all going to be inserted into a mysql database
and sorted out there, so there may be some fudge available there
but if php could do something nice in the code, that would be
preferable.
Thanks in advance.
Andrew

Drewbles wrote:
> However, firstly I'm not sure how to write this and
secondly, how do you check
> if a text box is empty?
Believe it or not, with the PHP function called empty();
http://docs.php.net/manual/en/function.empty.php
if (empty($_POST['fieldName'])) {
// give a score of 0
} else {
// give a positive score
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • Test if text box is empty - advanced actions

    Hi,
    I have a form that the user is required to fill in. When the user tries to progress to the next slide I would like to test to check that none of the text boxes are empty.
    Ideally something like;
    if ((Textbox1) == null){
    show failure caption
    } else {
    continue
    I know you can use advanced actions however I'm having trouble defining null. I've even tried creating a variable and leaving it blank and testing the textbox against that however it doesn't seem to work either.
    I'm probably missing something simple as I am very new to Captivate.
    Is there a way to hand code advanced actions using AS?
    Any help would be greatly appreciated!!
    Regards
    Tim

    Hi!
    I had the same problem.
    User has to enter his name.
    I predefined the variable of the textbox with an action at the "what should happen if you reach this slide" feature. You can find it if you doubleclick on the slide with your textbox, then look in the area "navigation". I have a German version of Cap4 so the names of features and functions differ...
    Declare the variable of your textbox let's say "ABC123".
    With an advanded action you can check if the text inside the variable changed from ABC123 to anything else:
    if
    variable_name is not equal to ABC123
    then
    else
    If the variable is still ABC123 I jump to another slide with an error message.
    An example you can find here:
    http://forums.adobe.com/thread/446449?
    Regards,
    Markus

  • Can't use all annotate actions in Preview-it's a PDF of a web screen shot. No highlight, underline, etc; can insert text, boxes, notes.

    I can't use all the annotate actions in Preview. It's web screen shot saved as a PDF. No highlight, underline, or strikethough text but I can insert text, boxes, notes. On other forums this problem was solved by saving as a PDF which I have done. Any other solutions?

    I don't think PDF is the way to do it, but if it was you'd need something like Adobe Acrobat Professional.
    >I'm updating the content and copy for a website and thought the easiest way would be marking up a PDF of the webpages including highlighting text to be removed, etc.
    As far as Text changes, I thing the actual Source would maybe be the way to go, but you could always turn the PDF into a jpg or such, then use a Graphics program to poit out things...

  • Comparing text box with empty string

    Here is the procedure how to do it - but it does not work for me.
    http://blogs.adobe.com/captivate/2010/12/few-tips-on-%E2%80%98advanced-actions%E2%80%99.ht ml
    Could someone please confirm if the procedure mentioned in the blog is working or not, and if it's working, then what did I mess up in the first case below?
    In summary, I created a variable stringEmpty and created Advanced Action with condition associated with a button. I also created variable varUserName and associated it with a text box.
    There are 3 cases and 3 different behaviours.
    First case:
    stringEmpty =
    advanced action condition: varUserName; not equal to; stringEmpty (variable)
    After clicking the button, the result is as if the condition was always false (i.e. as if the string in the text box was always equal to stringEmpty)
    Second case:
    stringEmpty = aaa
    advanced action condition: varUserName; not equal to; stringEmpty (variable)
    After clicking the button, the condition is met when user enters "bbbbbbb" (which is OK). However, if he does not enter anything, only clicks the button, the condition is not met (which is incorrect behaviour, because "" <> "aaa" so the condition is met)
    Third case:
    advanced action condition: varUserName; not equal to; cccc (literal)
    In the third case all is OK.

    Hello,
    Each entry in a TEB has to be confirmed before it will get into the variable associated with it. This can be done with the Submit button or you can assign a shortcut key to it or use both. So I would really recommend to check if the variable is populated before you trigger your advanced action. You can do that by inserting temporarily a Text Caption that shows this user variable. Working with 2 TEB's on a slide: I tried to explain the workflow in another blog post:
    One submit button for multiple Text Entry Boxes
    To check if somewhere a scored object has been slipping in: check the Advanced Interaction view (F9)  which gives you an overview of all scored things.
    Lilybiri

  • Text box not showing full text

    Hi everyone
    I have a text box which i am using to display the path of a
    perticular file. but if the path is long then is doent get
    displayed on the text box which is of specific dimension. I cannot
    change the dimensions of the text box coz it will give a bad effect
    on existing UI.
    Also i tried using "Scroll", " Adjust to fit" and " fixed"
    options for the text box but that even didn't work . If I put the
    Wrap property to ture then the size of the text box is changed
    which again coz the UI to look bad.
    Plz tell if we have something wherein we have cursor to move
    till the end of line...
    So i want your quick help on this..
    Thanks in advance.

    thanks neek for that quick reply.
    it's not working out at my end.
    The properties that i have tried and applied are as follows:
    Field Properties: Framing - "Adjust to fit "
    editable = "true"
    Wrap = " False "
    Tab = "False"
    the problem is the cursor is not moving forward..
    I tried all other permutation and combinations but it's not
    working...
    Any other tip might be useful...
    Thanks
    Atul Saxena

  • Text boxes not appearing - CAPTIVATE1.1

    I have a number of delegates using Cap1.1 - on some machines
    when recording screens, the automatic text boxes are not appearing
    when the recording has finished. (the "text box" option is checked
    on all PCs in the custom options settings)
    I`m sure i`ve heard this could be something to do with Flash
    players - I checked one of the machines that is facing the issue
    and its using Flash 9.
    any help would be great
    cheers

    Sorry, I only keep the current version and one version back
    due to storage limitations. I would note that there are few things
    more difficult than to suggest a correction for an "intermittent"
    problem, but I'd have to say an intermittent problem
    on a version that was replaced years ago would definitely
    qualify as the most difficult of all.
    That said, maybe we can offer some help if we knew what the
    problem was. You don't really say, except that some text-captions
    on some machines are not appearing. That is not really helpful in
    troubleshooting.
    What is being recorded - exactly?
    Where is it being recorded from - Internet, local drive,
    etc.?
    What are the delegates (what's a delegate?) doing at the time
    they expect, but are not getting, automatically-generated
    text-captions?
    I am relatively certain that the problem (if I understand
    that part), has nothing at all to do with the Flash Player version
    installed, but beyond that, I'm sorry that all I can offer is
    questions instead of answers.
    Welcome to the User-to-User forums, hardyandy. Hopefully you
    can give us enough additional information that we can take a stab
    at helping out.
    .

  • Text box not displaying

    Marking up a PDF using the text box tool in Adobe 7.0.9, saving the PDF. Then a MAC user using Adobe 8.1.2 opens the PDF and cannot see the text box tool.
    If you open the same PDF on a PC running Adobe 8 you can.
    Why can't you see the text box tool on the MAC?

    >Why can't you see the text box tool on the MAC?
    Are you saying they don't have the tool at all or they don't see the text you added using that tool?
    More importantly, are they actually using Adobe Acrobat or are they using Adobe Reader?
    (You just mentioned "Adobe" which is the name of the company not any particular application)
    Are you sure they're using an Adobe product at all and not opening it in Mac Preview?

  • Adobe Acrobat Pro text box not printing and is hidden under box highlight.

    Adobe Acrobat Pro 10.1.13.  I am completing a form with text box throughout the document. I can no get the text box to printing and the text is hidden under box highlight.  I have tried printing with the print feature 'Comments & Forms/ Document and Markups' with no luck.

    It's doing that because you have field highlighting enabled. YOu can either turn it off or make the field read-only (if it's only used for display and not entry).

  • Indesign CS3 : Inset spacing preview in text box not there anymore.

    Hi!
    In Indesign CS2, I could see a "preview" of the inset spacing of my text boxes in "Preview Mode (W)".
    In Indesign CS3, I can't see it anymore unless I move my text boxes (the preview of the inset spacing of my text boxes shows only when I move the boxes).
    This is bad, because I can't see really fast which boxes have inset spacing and which ones don't.
    Please help me!
    Thanks,
    Chris.

    Yes.
    Normal Mode hides all of those things. But Preview Mode shows all of those things (unless otherwise selected in the "View" menu).
    I need to see the inset spacing of my text boxes in Preview Mode without having to move them.
    Here is an image of my text box in Preview Mode (guides, invisible characters, etc. are visible, but not the inset spacing): http://www.chris.lafacade.com/share/01.jpg
    Here is an image of my text box in Preview Mode while I move my box. As you can see, the inset spacing shows: http://www.chris.lafacade.com/share/02.jpg
    I need the inset spacing to show all the time in Preview Mode.
    Thanks!
    Chris.

  • How to edit multiple text boxes (not linked/chained) in story editor?

    I don't have a book with running text, but lots of pages (70) with separate text boxes on each page plus some captions. It is a design for exhibition panels.
    It is really painful to proof read. And taking a print for all these pages to proof read is a waste! Is there no way I can see "all" the text in a view, one by one (without selecting the text boxes on each page) to simply review and edit the text? Is the story editor so basic? (I don't see any options or functions in the story editor window!)

    No way I know of in InDesign but what you could do is export all the content to an InCopy assignment. Open the assignment in InCopy and then check it out. That will give you all the stories to edit in Galley, Story or Layout view.
    InCopy is a part of Creative Cloud. If you're on something earlier, there's little else I can offer unless you happen to be on CS6 since InCopy CS6 can still be purchased.

  • Text boxes not being carried over in Captivate 5

    Hi,
    I am trying to import a PPT presentation into Captivate 5. The process is simple enough however, once the slides are converted, it's nor carrying over the text boxes. The slide titles and inserted diagrams are there but no text!
    Any ideas please?
    Thanks

    Hi,
    Would it be possible to share the PPT or CPTX file so that we can investigate the issue?
    Thanks,
    Vikranth.

  • Text Entry Box--Advanced Actions--Conditional Statement--Double quotes in literal input value

    Hello forums,
    I'm new to the forums (and Captivate in general), but I'm having a real problem carrying out a tutorial design and I think you may be my only hope.  Let me explain what I want to do and the difficulty that I'm having:
    I'm an instruction librarian at a university, and I'm designing an interactive tutorial for English 100 students to complete in order to become familiar with how to search the library catalog.  What I've done is taken a screenshot of the catalog search page, made it the background of a slide in Captivate (vers. 6), and placed a text entry box over the search bar in the screenshot.  The idea is for the students to conduct a simulated search by choosing one of three suggested search string formulations, and depending on the search string they enter, the tutorial will jump to a slide featuring a screenshot of what the actual search results would look like.  The idea is to emphasize the use of keywords over full-sentence phrases, and the use of double quotation marks to enclose multi-word search terms.
    So I've set the action for the TEB to "Execute Advanced Actions" and then created some IF/THEN statements in the "Advanced Actions" pop-up window (with action type set to 'conditional'). The script is such that if the student enters the first search option (how does sleep affect college students) in the TEB, the tutorial jumps to 1 slide, if they enter the second option (college students AND sleep), featuring a Boolean operator (AND), the tutorial jumps to a 2nd slide, and if they enter the third option ("college students" AND sleep) with the double quotes around "college students" and the Boolean operator, the tutorial should jump to a 3rd slide.  This action script works fine for the first two input options, but I can't make it work for the third search option.
    I think that it has something to do with the fact that the third input option features double quote marks, and this seems to throw off the script (I tried a quote-less input value for the third IF/THEN just to make sure that it would work jumping to the 3rd slide and it did), and I'm wondering if anyone has any suggestions as to how I can get around this issue.  Again, I need it to work so that if the student enters "college students" AND sleep, with the quote marks and the Boolean operator, the tutorial will jump to a slide showing the search results if those search terms were used in a real search of the catalog.
    I'd be extremely grateful for any help that anyone here can give me, we've been trying to make our online tutorials more engaging and interactive (and therefore more interesting), and I think this would be a great way to teach students about using quotes in their catalog searches.
    Thank you for your time and consideration.
    Andrew Wilk
    College Library
    UW-Madison

    The tutorial is for a "how to use catalog searching" instruction in an undergraduate library session.  We use boolean operators (AND, OR, NOT) to combine search terms, ex. to search for books about the sleeping habits of college students, I would enter "college students AND sleep."  Because "college students" is a multi-word phrase to describe one concept, I need to put quotation marks around the phrase to prevent the catalog from searching for the individual words separately, so the most correct search becomes ["college students" AND sleep] with quotation marks around only "college students," a user-typed "AND," and the word "sleep" (no q-marks).
    A colleague of mine worked out a pretty cool (if complicated) solution that I'll share if anyone is interested.  Since the q-marks where the problem, we've set it up so that the TEB validates the response for the search string with q-marks around "college students." If they enter it correctly, the tutorial jumps to the corresponding slide. The attempt # is set to 1, and if the user fails to enter the validated phrase (they misspell or use one of the other response options) then the TEB is set to run an Advanced Actions Script in which the other two options are scripted in IF/THEN statements that cause, when the term is entered correctly, the tutorial to jump to their corresponding slides. We've created another tab of IF/THEN statements that say that if the response is NOT equal to one of these response options, then the slide restarts (technically the slide "jumps" back to itself and starts over) and the user gets another chance to start the cycle over again.
    I know this is confusing (I had a really hard time explaining it in words), so if anyone is interested I could make a Jing video when I have some time.
    Thank you for all your suggestions

  • How do I pass multiple values from a text box to an update statement

    I hope this does not sound to lame. I am trying to update multiple values Like this:
    Code|| Computer Desc || Computer Price || Computer Name
    SEL1 || Apple macbook || 1564 || Apple Macbook Basic
    SEL2 || Dell 630 || 1470 || Dell Latitude
    I want to change all six values at once in one update statement based on the Code, I can't find a good tutorial/example to help me.
    Can anyone point me in the right direction?
    Thanks so much,
    Laura

    You can do conditional updates with decode or case statements e.g.
    SQL> create table t as
      2  select 'SEL1' as code, 'Apple macbook' as comp_desc, 1564 as comp_price, 'Apple Maxbook Basic' as comp_name from dual union
      3  select 'SEL2', 'Dell 630', 1470, 'Dell Latitude' from dual
      4  /
    Table created.
    SQL>
    SQL> update t
      2  set comp_desc = CASE code WHEN 'SEL1' THEN 'Test1' Else 'Test2' END,
      3      comp_price = CASE code WHEN 'SEL1' THEN 1234 Else 2345 END,
      4      comp_name = CASE code WHEN 'SEL1' THEN 'Test1 Name' Else 'Test2 Name' END
      5  /
    2 rows updated.
    SQL>
    SQL> select * from t
      2  /
    CODE COMP_DESC     COMP_PRICE COMP_NAME
    SEL1 Test1               1234 Test1 Name
    SEL2 Test2               2345 Test2 Name
    SQL>

  • This test  to display text field in a conditional statement

    Still a newbie! I want to test the display for my calc app so that you can't add zeros to the display's default zero i.e. if the display is "0" and I keep pressing the "0" key , it won't get appended to the first zero.
    if(nonum == "0") doesn't seem to work
    public boolean processKey (int keyCode) {
    String newnum = curnum;
    String nonum = display.getText();
    if (keyCode >= 0 && keyCode <= 9){
    if(nonum == "0"){
    newnum = Integer.toString(keyCode);
    System.out.println("display reads "+nonum);
    }else{
    newnum += Integer.toString(keyCode);
    else if (keyCode == POINT)
    newnum += ".";
    try {
    Double.parseDouble(newnum);
    curnum = newnum;
    System.out.println("newnum = " + newnum);
    System.out.println("curnum = " + curnum);
    return true; }
    catch (NumberFormatException nfx) {
    return false; }

    Since you are storing the number as an 'int' and then converting that int to a String for display, then you shouldn't expect 0's to be added on if the number is currently 0:
    1) curnum = 0
    2) 0 key is pressed
    3) curnum = curnum * 10 + 0 = 0 * 10 + 0 = 0
    A real calculator wouldn't keep appending 0's... at least, not a simple calculator comparable to the one you are writing. If you want to append 0's, try this:
    - Keep a count of the number of 0's pressed.
    - If curnum is changed to 0 (by pressing clear, for example, or turning on the calculator), reset the zero count to 1.
    - Each time the '0' key is pressed, if curnum is 0, then increment the '0' count.
    - When you update your display, use the following logic: if curnum is 0, then display the number of 0's specified in the zero count, otherwise just display the value of curnum.
    Jason

  • How to copy/paste anchor text box to its anchor point in text and delete all empty anchors?

    hi all
    i have a document of few pages but one story. The right column is the main text box and on many places anchored text boxes are placed which appeared on the left column as shown below.
    i want text of each anchor-text-box to be cut from its place and paste at its insertion/anchor point and delete all empty anchored boxes.
    I am trying since morning but i unable to reach anchor object reference. Any help on how to start with will be helpful.
    virender

    Ok, let's say you have one main text box (not anchored) and three text boxes that are anchored to text within it. The first one is anchored with text, the second one is unanchored, and the third one is empty (I'm not going to get into inline anchoring vs. custom anchoring since you didn't bring it up in your post).
    We cycle through the items on the page:
    function main(){
      var myDoc = app.activeDocument;
      var myPages = myDoc.pages.everyItem().getElements();
      for (var i = 0; i < myPages.length; i++){
        var myPage = myPages[i];
        //Checks that the page is valid, and that it is not a master page. If either is true, skips to the next page.
        if (myPage.isValid == false) continue;
        if (myPage.parent instanceof MasterSpread) continue;
        var myItems = myPage.allPageItems;
        for (var j = 0; j < myItems.length; j++){
          //Current item.
          var myItem = myItems[j];
          //If myItem doesn't have a Character parent, it is not anchored.
          //The first and third text frames would fail this test.
          if (!(myItem.parent instanceof Character)) continue;
          //We only care about text frames.
          if (!(myItem instanceof TextFrame)) continue;
          //I think the only way this would happen would be if you had an image or
          //something else unexpected within the frame. I check for it so no content
          //is inadvertently lost.
          else if (myItem.texts.length > 1) continue;
          //If we're still in this iteration of the loop, all qualifications are met.
          //Flatten the text frame.
          //I don't use layers that often so, to me, flatten makes sense. You may want
          //to use a different term if there's a chance for confusion.
          flattenItem(myItem);
    function flattenItem(funcItem)
         //Hold onto the anchor character.
        var myParent = funcItem.parent;
         //Duplicate the text from within the frame so that it appears right after the anchor.
         //There may be other methods, but this works for me. I try to avoid copy/paste
         //so as not to deal with any clipboard mishaps. I added a check in case of empties.
         if (funcItem.texts.length > 0){funcItem.texts[0].duplicate(LocationOptions.AFTER, myParent.insertionPoints[0]);}
         //Replace the anchor character itself with a space (or whatever) which also
         //deletes the text frame it was anchoring.
        myParent.contents = " ";
    I guess the takeaway might be that you're not looking at the main text frame and then checking to see if anything is anchored to it. You're looking at each text frame and figuring out if it is anchored. That's my approach, anyway.

Maybe you are looking for

  • Wildcards in Generic sort filter

    Hi, is it possible to use wildcards in the Generic sort filter in transactions? And if yes, which ones? Problem is the following: I get a list of orders from SAP, and I want to select only the orders that are released, so I have to filter on Ordersta

  • FF4.0 wants to download a .asp page ratehr than open it. How do I change this behavior?

    I am on a OSX 10.6.7. One example of the page that I want to open is at http://tinyurl.com/3moz8fk When I click on the link, FF downloads the page. When I enter the link in Safari, it opens as expected. I don't see anywhere that I can change the beha

  • Why is iPhoto suddenly in my Trash basket?

    Why does iPhoto suddenly appear in my Trash basket, and how do I get it out? 

  • Software error with itunes

    After installing an iTunes update to my MacBook Pro with Retina display, mid-2012 baseline model running OSX Mountain Lion, I kept getting this error showing up both initially and randomly afterwards.

  • Can't get green gems in clash of clans

    Whenever I try to buy those green gems; It won't let me and says that I needed to go to apple/support. I would also like to add, that I kept trying to use my debit card quite a bit. But, it didn't work, so I tried to use a different debit card and it