Math.min JavaScript help needed

Hello,
I am trying to write a script for a fillable PDF in Adobe Acrobat, but I don't have much experience with JavaScript and I need some help!
Basically I have three fields as follows:
A1 = a field with a number value in it
B1 = a field with a number value in it
C1 = a field where the sum calculation will be.
I want to write a script that will enter the lesser of the values in A1 and B1 into C1. If no value has been entered into B1, then it enters the value of A1 into C1.
This is what I have come up with so far:
    // Get the field values, number fields as numbers
    var d1 = getField("A1").value;
    var d2 = +getField("B1").value;
    // Set the field value to either A1 or B1, whichever is lesser
     event.value = Math.min(d1,d2);
Some of the problems with the script so far are:
It does not calculate correctly if there is no value entered in B1 (should give just A1).
It doesn't update the event.value if A1 is changed (until another form field is modified)
Can anyone help??
Thanks!

Adjusted the field calculation order fixed question 2.
The script given as answer worked great except for one area.
B1 values can range from 0 and up. If a 0 is entered in B1, then the Math.min ignores it since d2=="".
I can get around that problem by having a default value set in B1 of -1 (outside of the range). I'd prefer that there not be a default value set.
Any suggestions? I appreciate the help.

Similar Messages

  • If/then JavaScript help needed

    Hello,
    I am trying to write a script for a fillable PDF in Adobe Acrobat, but I don't have much experience with JavaScript and I need some help!
    Basically I have five fields as follows:
    A1 = a checkbox
    B1 = a field with a number value in it
    C1 = a field with a number value in it
    D1 = a field with a number value in it
    E1 = a field where the sum calculation will be.
    I want to write a script that will enter the sum of values of B1+C1+D1 into E1 if the checkbox in A1 is checked yes.
    If it is not checked yes, then it will enter the sum of values of B1+C1+ the value of D1 divided by 2 (and rounded down) into E1.
    Can anyone help??
    Thanks!

    This should do it as the custom Calculate script for E1:
    // Custom calculate script
    (function () {
        // Get the field values, number fields as numbers
        var a1 = getField("A1").value;
        var b1 = +getField("B1").value;
        var c1 = +getField("C1").value;
        var d1 = +getField("D1").value;
        // Set this field (E1) value based on the state of the check box
        if (a1 === "Off") {
            event.value = b1 + c1 + d1;
        } else {
            event.value = b1 + c1 + Math.floor(d1 / 2);

  • Ipod mini troubles: Help Needed

    I really need help with ipod mini troubleshooting..
    I've had my Ipod mini for about 3 years now and lately have been running into a few problems.
    In the past few months:
    -My Ipod's "battery meter" has been acting really strange, one second it may be reading as 3/4 full, and the next it shuts down saying that my battery has depleted, then a few minutes later it will be reading full again. And just to let you know, I always charge it overnight to avoid having a dead battery, and I always make sure to properly shut it off using "hold".
    Resetting my ipod works sometimes, but other times doesn't..
    Yesterday:
    My Ipod is no longer responding at all, and I'm pretty sure I know why: Some careless person spilled some water near and on my ipod, I dried it off as soon as I could. It was working properly shortly afterwards, but a few hours later, it shut off saying that the battery was dead again, and a picture of a "cartoon ipod" with dead eyes("XX") appeared on my screen, and it said under the picture to go to "www.apple/support/ipod". This was when it wasn't connected to a power source. When I connected my ipod to my computer via USB, my itunes does not recognize that it is connected ("Do not disconnect" does not appear on my ipod) and a picture of a "dead battery" has appeared on my screen, it is not in the "recharging mode" either (with the picture of the battery moving).
    I tried re-setting it numourous times, and always end up with either the "dead battery" picture, or the "dead cartoon ipod" picture on it.
    Help would be greatly appreciated, as I use my ipod everyday for school and leisure.
    Thanks.

    I've tried that several times without luck.

  • Urgent: Chart Axis with Min, Max, Help needed.

    Hi guys,
    I am rushing on a report submodule in our application, which will go on live in a short time. We need to have charts which use min and max value from the table and calculate the appropriate interval as the scale of the axis, instead of the default interval.
    I also tried to put page items into the Min&Max in the chart attributes, but always got the error message that asks for a number.
    I have searched the forum and the conclusion I can made now, is that HTMLDB does not support parameterized value for chart axis.
    So, my question is: if I have to do it manually, how should I do it? I don't have much experiences in pl/sql, so really need some help here.
    Any input is appreciated.

    Does anybody know whether a chart can be built on a collection? I've tried but didn't succeed.
    If somebody has experiences on this, please let me know, so I won't waste more time on trying it if the answer is no. Thanks.

  • Javascript Help Needed Again

    Hi there, I am not very good with Javascript, so was looking
    for some help.
    I have a select list for an order checkout page, which is
    basically how
    people heard about the site. You select one, and depending on
    what it
    is, another form field will appear with a message asking for
    more detail.
    For instance, if they selected Search Engine, another field
    would appear
    with the text "Which search engine" and a form field for them
    to enter
    it into.
    What is the best way to do this? Some of the options in the
    select list
    won't need the additional field.
    Cheers,
    Steve

    Dooza wrote:
    > Dooza wrote:
    >> Hi there, I am not very good with Javascript, so was
    looking for some
    >> help.
    >>
    >> I have a select list for an order checkout page,
    which is basically
    >> how people heard about the site. You select one, and
    depending on what
    >> it is, another form field will appear with a message
    asking for more
    >> detail.
    >>
    >> For instance, if they selected Search Engine,
    another field would
    >> appear with the text "Which search engine" and a
    form field for them
    >> to enter it into.
    >>
    >> What is the best way to do this? Some of the options
    in the select
    >> list won't need the additional field.
    >
    > Ok, I have almost got this sussed, just need some syntax
    help :)
    >
    > function toggleElement(sel1, element1) {
    >
    > element1 = document.cart.elements[element1];
    > //alert(element1.value);
    > if (sel1.value == 'searchenginelisting') {
    > element1.value = 'Which search engine?';
    > element1.style.display = 'inline';
    > }
    > if (sel1.value == 'searchenginesponsored') {
    > element1.value = 'Which search engine?';
    > element1.style.display = 'inline';
    > }
    > if (sel1.value == 'banner') {
    > element1.value = 'Which website?';
    > element1.style.display = 'inline';
    > }
    > else {
    > element1.value = ''; // input text will be empty
    > element1.style.display = 'none'; // hide text element
    > }
    > return;
    > }
    >
    > It currently only works when you select banner from the
    select list.
    > When you select the first 2 it does nothing. Its the way
    its nesting the
    > IFs, can anyone tell me how to sort this out?
    >
    > Cheers,
    >
    > Steve
    function toggleElement(sel1, element1) {
    var element1 = form.elements[element1];
    if (sel1.value == 'searchenginelisting' ||
    sel1.value == 'searchenginesponsored'){
    element1.value = 'Which search engine?';
    element1.style.display = '';
    return;
    if (sel1.value == 'banner') {
    element1.value = 'Which website?';
    element1.style.display = '';
    return;
    element1.value = ''; // input text will be empty
    element1.style.display = 'none'; // hide text element
    Mick

  • Javascript Help Needed to Show/Hide Regions

    version 4.0.2.00.07
    Hello,
    I'm hoping that someone would help me with creating a Javascript function to Show/Hide regions.
    I have a Select List defined as Checkboxes that when clicked I would like to show specific regions that contain fields that are specific to that checkbox selection. There are currently four selections available. There are two selections that would show one region and the other two selections would show the other region.
    Please let me know if I need to clarify anything.
    Thanks,
    Joe

    There is an out-of-box solution that may help you - check out the "Customisation" section in the region properties.
    Otherwise, you might like to explore using a Dynamic Action to show/hide your region based on an event on your relevant checkbox.
    Either way, you should have a declarative solution when you thought you might need to hand-code some javaScript :-)
    ps - thanks for providing your Apex version.

  • Javascript help needed (confirmation for cancel button )

    Hi guys!
    I am not good at javascript but am going to improve shortly :-). Now i need very quick fix.
    I'm using <html:cancel> button in Struts 1.1 and I'm using without thinking the following code:
    <html:cancel onclick="bCancel=true;" >
    <bean:message key="cancel.operation"/>
    </html:cancel>
    It is not that important though. I would like very much to alert user on possible loss of data (long multipaged form - could press mistakingly, who knows).
    Would you, please post the javascript code that is needed to accomplish this - just alert and if yes - cancel, no - leave alone?
    I'll really appreciate this.

    Thank you for your response.
    I also manage to write this. Is this correct?
    <script language="JavaScript">
    function ensure() {
    return confirm("Are you sure that you want to cancel this operation?");
    </script>
    <td colspan="3" align="center">
    <html:cancel onclick="bCancel=ensure();" >
    <bean:message key="cancel.operation"/>
    </html:cancel>
    </td>

  • Images with hyperlink in javascript - help needed

    Hai,
    I am having two hyperlinks say, "Good Morning" and "Good Evening". When I am clicking "Good Morning", a small arrow or a picture should display with the hyperlink.
    When I am clicking "Good Evening" this one should have the small arrow or a picture and "Good Morning" will be displayed normally (without picture).
    How can I do this using javascript?
    Did anyone has the code? Pls help me.
    <html>
    <head>
    <title>
    Moves the Arrow When Clicked the Headings for Sorting purpose
    </title>
    <SCRIPT language="JavaScript">
    function remove_picture() {
    function set_picture() {
    </SCRIPT>
    </head>
    <body bgcolor="peachpuff" width="90%" align="center">
    <table>
    <tr>
    <td align="left">Good Morning</td>
    <td>Good Evening</td>
    </tr>
    </table>
    </body>
    </html>
    - yogee

    <html>
      <head>
        <style type="text/css">
          #notclicking .highliter {
            display: none;
          #clicking .highliter {
            display: inline;
        </style>
        <script type="text/javascript">
          function showHighliter(elem) {
            elem.id="clicking";
          function hideHighliter(elem) {
            elem.id="notclicking";
        </script>
      </head>
      <body>
        <a href="#" id="notclicking"
           onfocus="showHighliter(this);"
           onblur="hideHighliter(this)">
          <img border="0" class="highliter"
               src="http://forum.java.sun.com/im/duke.gif"/>
          Good Morning
        </a><br/>
        <a href="#" id="notclicking"
           onfocus="showHighliter(this);"
           onblur="hideHighliter(this)">
          <img border="0" class="highliter"
               src="http://forum.java.sun.com/im/duke.gif"/>
          Good Evening
        </a><br/>
      </body>
    </html>

  • Javascript help needed if possible

    I am trying to combine code from codaslider and shadowbox, but whatever I try, my code is basically rubbish!!
    I want to combine the following two links in to one:
    <a rel="shadowbox[Mixed];width=640;height=360" href="#">
    <a class="xtrig" href="#1" rel="coda-slider-3">
    I am fairly certain that all I need to do is combine the two 'rel=' parts of the code to get it working. Basically, what I am trying to do is stop codaslider from sliding when I click and instigate the shadow box. Is it possible?
    TIA
    Mat

    No, it can't be done. JSP code runs before the HTML page is generated; it's a server side technology. JavaScript runs on the client's machine, after the page has been rendered.

  • Javascript Help needed

    We have a requirement to not display report until the user selects some requirements, and we also need to ensure a user has selected a value for certain prompted columns.
    As such, we have written a custom Javascript for a custom "Go" button on our dashboards. The JS validates the required fields and generates a Go URL which loads into an iFrame when the custom button is clicked. This works fine in Internet Explorer, but in Firefox the prompt values are not being passed into the Go URL string. This is a security risk as it shows all data on the report when it shouldn't for certain users. Can anyone look at the JS code below to see why it won't work in Firefox?
    Thanks
    removed code, sorryEdited by: odinsride on Feb 10, 2011 9:17 AM

    if(navigator.appName == 'Microsoft Internet Explorer')That would be the reason your code doesn't work in Firefox - most of it is inside an IE-only if clause!
    Surely there must be a better way to achieve your requirement rather than to use all that javascript. One technique I've used to force a user to make a prompt selection is to use nonsensical default values on your prompts. By doing this you are guaranteed that the report will give 'no results' when it is first run. You can then add a no results view to the report and add your own custom message saying 'please make some selections from the prompts above'.

  • -How to change the Alternate Apple ID? My account has an alternate address which is NOT MINE and I need to change it. Please, help!

    -On iCloud, how can I change the Alternate Apple ID? My account has an alternate address which is NOT MINE and I need to change it ASAP. Please, help!

    Read here >  How do I change my alternate Apple ID

  • I switched to Galaxy and I cannot get my messages from I-phone users. I still have my ipad mini but I need to get my messages on my phone...Help!

    I switched to Galaxy and I cannot get my messages from I-phone users. I still have my ipad mini but I need to get my messages on my phone...Help!

    as robdrage says - they will need to send txts, not imessages.  And if you have not already done so - log into apple dot com and get to your profile / device list, and remove the phone.  If apple thiks the device is active, and the phone number is the same, it will continue to intercept and misdirect messages. 
    take a look at this - near the end i how to do it at apple.com  (it is not real clear  on the web page)
    http://www.samsung.com/us/support/SupportOwnersFAQPopup.do?faq_id=FAQ00053450&fm _seq=62995

  • Help needed:Printing HTML file using javax.print

    Hi
    I am using the following code which i got form the forum for rpinting an HTML file.
    The folllowing code is working fine, but the problem is the content of HTML file is not getting printed. I am geeting a blank page with no content. What is the change that is required in the code? ALso is there any simpler way to implement this. Help needed ASAP.
    public boolean printHTMLFile(String filename) {
              try {
                   JEditorPane editorPane = new JEditorPane();
                   editorPane.setEditorKit(new HTMLEditorKit());
                   //editorPane.setContentType("text/html");
                   editorPane.setSize(500,500);
                   String text = getFileContents(filename);
                   if (text != null) {
                        editorPane.setText(text);                    
                   } else {
                        return false;
                   printEditorPane(editorPane);
                   return true;
              } catch (Exception tce) {
                   tce.printStackTrace();
              return false;
         public String getFileContents(String filename) {
              try {
                   File file = new File(filename);
                   BufferedReader br = new BufferedReader(new FileReader(file));
                   String line;
                   StringBuffer sb = new StringBuffer();
                   while ((line = br.readLine()) != null) {
                        sb.append(line);
                   br.close();
                   return sb.toString();
              } catch (Exception tce) {
                   tce.printStackTrace();
              return null;
         public void printEditorPane(JEditorPane editorPane) {
                   try {
                        HTMLPrinter htmlPrinter = new HTMLPrinter();
                        htmlPrinter.printJEditorPane(editorPane, htmlPrinter.showPrintDialog());
                   } catch (Exception tce) {
                        tce.printStackTrace();
         * Sets up to easily print HTML documents. It is not necessary to call any of the setter
         * methods as they all have default values, they are provided should you wish to change
         * any of the default values.
         public class HTMLPrinter {
         public int DEFAULT_DPI = 72;
         public float DEFAULT_PAGE_WIDTH_INCH = 8.5f;
         public float DEFAULT_PAGE_HEIGHT_INCH = 11f;
         int x = 100;
         int y = 80;
         GraphicsConfiguration gc;
         PrintService[] services;
         PrintService defaultService;
         DocFlavor flavor;
         PrintRequestAttributeSet attributes;
         Vector pjlListeners = new Vector();
         Vector pjalListeners = new Vector();
         Vector psalListeners = new Vector();
         public HTMLPrinter() {
              gc = null;
              attributes = new HashPrintRequestAttributeSet();
              flavor = null;
              defaultService = PrintServiceLookup.lookupDefaultPrintService();
              services = PrintServiceLookup.lookupPrintServices(flavor, attributes);
              // do something with the supported docflavors
              DocFlavor[] df = defaultService.getSupportedDocFlavors();
              for (int i = 0; i < df.length; i++)
              System.out.println(df.getMimeType() + " " + df[i].getRepresentationClassName());
              // if there is a default service, but no other services
              if (defaultService != null && (services == null || services.length == 0)) {
              services = new PrintService[1];
              services[0] = defaultService;
         * Set the GraphicsConfiguration to display the print dialog on.
         * @param gc a GraphicsConfiguration object
         public void setGraphicsConfiguration(GraphicsConfiguration gc) {
              this.gc = gc;
         public void setServices(PrintService[] services) {
              this.services = services;
         public void setDefaultService(PrintService service) {
              this.defaultService = service;
         public void setDocFlavor(DocFlavor flavor) {
              this.flavor = flavor;
         public void setPrintRequestAttributes(PrintRequestAttributeSet attributes) {
              this.attributes = attributes;
         public void setPrintDialogLocation(int x, int y) {
              this.x = x;
              this.y = y;
         public void addPrintJobListener(PrintJobListener pjl) {
              pjlListeners.addElement(pjl);
         public void removePrintJobListener(PrintJobListener pjl) {
              pjlListeners.removeElement(pjl);
         public void addPrintServiceAttributeListener(PrintServiceAttributeListener psal) {
              psalListeners.addElement(psal);
         public void removePrintServiceAttributeListener(PrintServiceAttributeListener psal) {
              psalListeners.removeElement(psal);
         public boolean printJEditorPane(JEditorPane jep, PrintService ps) {
                   if (ps == null || jep == null) {
                        System.out.println("printJEditorPane: jep or ps is NULL, aborting...");
                        return false;
                   // get the root view of the preview pane
                   View rv = jep.getUI().getRootView(jep);
                   // get the size of the view (hopefully the total size of the page to be printed
                   int x = (int) rv.getPreferredSpan(View.X_AXIS);
                   int y = (int) rv.getPreferredSpan(View.Y_AXIS);
                   // find out if the print has been set to colour mode
                   DocPrintJob dpj = ps.createPrintJob();
                   PrintJobAttributeSet pjas = dpj.getAttributes();
                   // get the DPI and printable area of the page. use default values if not available
                   // use this to get the maximum number of pixels on the vertical axis
                   PrinterResolution pr = (PrinterResolution) pjas.get(PrinterResolution.class);
                   int dpi;
                   float pageX, pageY;
                   if (pr != null)
                        dpi = pr.getFeedResolution(PrinterResolution.DPI);
                   else
                        dpi = DEFAULT_DPI;
                   MediaPrintableArea mpa = (MediaPrintableArea) pjas.get(MediaPrintableArea.class);
                   if (mpa != null) {
                        pageX = mpa.getX(MediaPrintableArea.INCH);
                        pageY = mpa.getX(MediaPrintableArea.INCH);
                   } else {
                        pageX = DEFAULT_PAGE_WIDTH_INCH;
                        pageY = DEFAULT_PAGE_HEIGHT_INCH;
                   int pixelsPerPageY = (int) (dpi * pageY);
                   int pixelsPerPageX = (int) (dpi * pageX);
                   int minY = Math.max(pixelsPerPageY, y);
                   // make colour true if the user has selected colour, and the PrintService can support colour
                   boolean colour = pjas.containsValue(Chromaticity.COLOR);
                   colour = colour & (ps.getAttribute(ColorSupported.class) == ColorSupported.SUPPORTED);
                   // create a BufferedImage to draw on
                   int imgMode;
                   if (colour)
                        imgMode = BufferedImage.TYPE_3BYTE_BGR;
                   else
                        imgMode = BufferedImage.TYPE_BYTE_GRAY;
                   BufferedImage img = new BufferedImage(pixelsPerPageX, minY, imgMode);
                   Graphics myGraphics = img.getGraphics();
                   myGraphics.setClip(0, 0, pixelsPerPageX, minY);
                   myGraphics.setColor(Color.WHITE);
                   myGraphics.fillRect(0, 0, pixelsPerPageX, minY);
                        java.awt.Rectangle rectangle=new java.awt.Rectangle(0,0,pixelsPerPageX, minY);
                   // call rootView.paint( myGraphics, rect ) to paint the whole image on myGraphics
                   rv.paint(myGraphics, rectangle);
                   try {
                        // write the image as a JPEG to the ByteArray so it can be printed
                        Iterator writers = ImageIO.getImageWritersByFormatName("jpeg");
                        ImageWriter writer = (ImageWriter) writers.next();
                                       // mod: Added the iwparam to create the highest quality image possible
                        ImageWriteParam iwparam = writer.getDefaultWriteParam();
                        iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT) ;
                        iwparam.setCompressionQuality(1.0f); // highest quality
                        ByteArrayOutputStream out = new ByteArrayOutputStream();
                        ImageOutputStream ios = ImageIO.createImageOutputStream(out);
                        writer.setOutput(ios);
                        // get the number of pages we need to print this image
                        int imageHeight = img.getHeight();
                        int numberOfPages = (int) Math.ceil(minY / (double) pixelsPerPageY);
                        // print each page
                        for (int i = 0; i < numberOfPages; i++) {
                             int startY = i * pixelsPerPageY;
                             // get a subimage which is exactly the size of one page
                             BufferedImage subImg = img.getSubimage(0, startY, pixelsPerPageX, Math.min(y - startY, pixelsPerPageY));
                                                 // mod: different .write() method to use the iwparam parameter with highest quality compression
                             writer.write(null, new IIOImage(subImg, null, null), iwparam);
                             SimpleDoc sd = new SimpleDoc(out.toByteArray(), DocFlavor.BYTE_ARRAY.JPEG, null);
                             printDocument(sd, ps);
                             // reset the ByteArray so we can start the next page
                             out.reset();
                   } catch (PrintException e) {
                        System.out.println("Error printing document.");
                        e.printStackTrace();
                        return false;
                   } catch (IOException e) {
                        System.out.println("Error creating ImageOutputStream or writing to it.");
                        e.printStackTrace();
                        return false;
                   // uncomment this code and comment out the 'try-catch' block above
                   // to print to a JFrame instead of to the printer
                   /*          JFrame jf = new JFrame();
                             PaintableJPanel jp = new PaintableJPanel();
                             jp.setImage( img );
                             JScrollPane jsp = new JScrollPane( jp );
                             jf.getContentPane().add( jsp );
                             Insets i = jf.getInsets();
                             jf.setBounds( 0, 0, newX, y );
                             jf.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
                             jf.setVisible( true );*/
                   return true;
              * Print the document to the specified PrintService.
              * This method cannot tell if the printing was successful. You must register
              * a PrintJobListener
              * @return false if no PrintService is selected in the dialog, true otherwise
              public boolean printDocument(Doc doc, PrintService ps) throws PrintException {
                   if (ps == null)
                   return false;
                   addAllPrintServiceAttributeListeners(ps);
                   DocPrintJob dpj = ps.createPrintJob();
                   addAllPrintJobListeners(dpj);
                   dpj.print(doc, attributes);
                   return true;
              public PrintService showPrintDialog() {
                   return ServiceUI.printDialog(gc, x, y, services, defaultService, flavor, attributes);
              private void addAllPrintServiceAttributeListeners(PrintService ps) {
                   // add all listeners that are currently added to this object
                   for (int i = 0; i < psalListeners.size(); i++) {
                   PrintServiceAttributeListener p = (PrintServiceAttributeListener) psalListeners.get(i);
                   ps.addPrintServiceAttributeListener(p);
              private void addAllPrintJobListeners(DocPrintJob dpj) {
                   // add all listeners that are currently added to this object
                   for (int i = 0; i < pjlListeners.size(); i++) {
                   PrintJobListener p = (PrintJobListener) pjlListeners.get(i);
                   dpj.addPrintJobListener(p);
              // uncomment this also to print to a JFrame instead of a printer
              /* protected class PaintableJPanel extends JPanel {
                   Image img;
                   protected PaintableJPanel() {
                        super();
                   public void setImage( Image i ) {
                        img = i;
                   public void paint( Graphics g ) {
                        g.drawImage( img, 0, 0, this );
    Thanks
    Ram

    Ram,
    I have had printing problems too a year and a half ago. I used all printing apis of java and I still find that it is something java lacks. Now basically you can try autosense. To check whether your printer is capable of printing the docflavor use this PrintServiceLookup.lookupPrintServices(flavor, aset); . If it lists the printer then he can print the document otherwise he can't. I guess that is why you get the error.
    Regards,
    Kevin

  • Help needed by new Iphone 4s owner

    Help needed please - both my hubby and I have iphone 4s - I've just gone to download music onto my phone and have somehow managed to download all his stuff onto my phone and lost all of mine Is there anyway I can get my info back and delete his without restoring to back to factory settings (this was the first time I connected mine to the laptop to download and I'm not very good with the computer as you can see from my problem !) xx

    Thank you but I've not managed to download any I tunes yet but have got all his contacts and none of mine - thats what I'm trying to restore (sorry if not clear in question but as I said before I'm useless on computers)

  • URGENT HELP NEEDED - iPhone 3Gs no longer detected or charged by MacBook

    My iPhone 3Gs (3.1) has been running fine, until several hours ago today, when I plugged it to my MacBook, the iPhone is no longer detected - it doesn't show up in iTunes, nor it is charged. I tried opening iPhoto, and it wasn't there too. Not with Image Capture too. I tried charging it using the out-of-box wall charger using the same out-of-box USB cable I use for MacBook, and it can be charged without any problem. Then I put it into Recovery mode, and there iTunes can see it. I don't want to restore it before I figure out exactly what went wrong, as I don't want the restore process somehow gets stuck in the middle that the connection is lost again.
    I've tried reinstalled iTunes, including completely removal of Apple Mobile Device Support, as instructed by Apple. But still no luck.
    I've tried switching to another USB port of my MacBook. No luck.
    My iTunes is the latest 9.0.1, and my Mac OSX is 10.6.1. My iPhone is on 3.1, upgraded from 3.0.
    I've read from web that it seems I'm not the only one out there having this problem. But none of them seem having any real working solution.
    Urgent help needed & appreciated. Millions of thanks in advance.
    Gary

    1. I used both cables - theirs & mine ... and on several macs
    2. yes, same cable for wall & mac
    3. as said, i did completely remove & install itunes (incl. apple mobile device support), as instructed on the apple webpage
    anyway, did a restore just now. it seems okay now. but the problem is i have no idea what cause this, and i can't replicate the problem. so i don't know when it will happen again ... maybe a bug with os 3.1 ... others on web said os 3.1 is quite buggy ...

Maybe you are looking for

  • Firefox is unable to show the toolbar and wants me to re-install it, how do i do that?

    Since last night every time i try to use my Firefox it comes up with this warning: A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: chro

  • Snow Airport works fine -- but no wireless

    I've got an intermittent problem (the best kind, right?) with my Snow ABS: a couple times in the last few weeks, it appears to simply stop putting out a wireless signal. One of my machines is ethernet-wired to it, and so I know that it's working fine

  • Restarting, deleting tv shows, and auto-sync

    i have 3 questions.... 1 - my tv seems to be restarting quite often. my tv is left on all the time, when i leave i just turn my tv off. recently, it seems when i turn my tv on my tv restarts. also, i don't know if this has anything to do with this

  • Missing Audio File

    I worked on a project (Logic 8) a few months ago...everything was great...recorded some audio, did some editing, hid some tracks, exported an MP3, removed unused audio from the bin, everything was great and dandy. I opened the same project last night

  • Can a view include a variable

    So what I'm trying to do is create a modified version of a view that can accept a date range when run. I have come across references to "parameterized views" and views using "context variables". Can someone help me understand the difference between t