The javascript makes the input field to be null and cannot pass variable to

Hi
I use the following code to check whether the upload file is in the right format extension.
However, once I use it and it cannot pass the variable to servlet and throw nullpointerexception.
How can I fix it?
<script language="JavaScript">
    extArray = new Array(".jpg", ".png", ".gif");
    function LimitAttach(form, file) {
    allowSubmit = false;
    if (!file) return;
    while (file.indexOf("\\") != -1)
    file = file.slice(file.indexOf("\\") + 1);
    ext = file.slice(file.indexOf(".")).toLowerCase();
    for (var i = 0; i < extArray.length; i++) {
    if (extArray[i] == ext) { allowSubmit = true; break; }
    if (allowSubmit) return true;
    else
    alert("Please only upload files that end in types:  "
    + (extArray.join("  ")) + "\nPlease select a new "
    + "file to upload and submit again.");
    return false;
</script>
OnSubmit="return LimitAttach(this.form, this.form.myimage.value)"
servlet:
boolean isMultipart = ServletFileUpload.isMultipartContent(request);

the js works fine, just add id=myimage and it is ok
checking file type for uploading only image on client side

Similar Messages

  • Can we config the SU as an input field in source of putaway sys-guided ?

    Experts,
    If i want to do putaway system guided/by TO for SU managed materials , there is nothing that i need to scan in the source field and i can only see the SU,Storage bin input field in the destination screen(Can only config these two fields as input fileds for scanning).So the user has to manually hit F1 save and hit Next to go the destination screen.How should i have the SU field to be scanned in source? (Can we make the SU field as an input field for scanning in source screen?)
    Thanks in advance

    We have configured both SU and src bin as input fields on RF.  Are you using customised RF program or SAP standard?  WE have this driven through a mix of stnd and customised referring back to Verifcation Data Profiles and movt assignments in Mobile Data entry configuration of LE->WM

  • How to get the vlaue from an input field without hitting the enter button ?

    Hello All,
      Is there some way to read the values of an input field that was filled in by an user eg ..
    String userEntry = wdContect.<UIElement>.value;
      So far, I am only able to achieve this using the onEnter property whoch really is not very user friendly since I can only read in the values only if the user hits enter.
      Any help will be appreciated.  Thank you.
    from
    Kwok Wei

    1. Create a value attribute (MyText) in the controller context
    2. Create a value attribute (MyText) in the view context
    3. Map view context attribute to controller context attribute
    4. Create InputField in the view and map the "value" attribute to the MyText view context attribute
    5. Create Action on view (Send)
    6. Create Send button and specify Send action as onAction attribute
    7. Create executeSend() method on controller
    8. onActionSend() implementation:
      public void onActionSend(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSend(ServerEvent)
       wdThis.wdGet<controllername>Controller().executeSend();
        //@@end
    9. executeSend() implementation:
      public void executeSend( )
        //@@begin executeSend()
                   // Get MyText
                   String MyText = wdContext.currentContextElement().getMyText();

  • Javascript to copy input fields to another input field..

    Hi,
    I have Permanent address fields(input text fields) (address line 1,2,city, state , country,zip code)  and present address fields with same input fields as premanent address
    and i have a check box is present address different with value Y when checked and N when unchecked
    so based on the check box checked and unchecked the permanent address should copy to present address.
    i dont know how to use java script in adf
    so some one  please help me to do this.
    thanks in advance
    cheers

    Hi Suchith,
    I will tell you how to achieve your case using the framework itself;
    1.- Add to your checkbox a setPropertyListener for each field you want to copy. So for the first one addressLine1 I assume the component value resides in your binding layer, you do
    from=#{bindings.yourCheckBox.inputValue eq 'Y' ? bindings.addressLine1.inputValue : null}
    to=#{bindings.otherAddressLine1.inputValue}
    type='valueChange'
    And the same for each field. All in the checkbox component.
    Since this is a business rule, you should always aim to write this kind of logic in the model layer so you can create a method in your ViewObjectRowImpl named copyAddress() and in there you copy the values from one field to another field. Then you expose this method in the client interface and execute it when clicking the checkbox. Add autosubmit=true and partialTrigger to the panel containing your other fields to be refreshed.
    Once again I am making a lot of assumptions about your model, but that is why you always need to first state the version of your JDeveloper, then give a clue about your model and where are the fields being stored and so on. So people can help you better.
    Regards

  • I have recently updated my iTunes to the latest software. Since then my iphone will not sync with the computer, it doesn't show up in my computer any more. The computer makes the bing sound as I plug in but i am unable to sync, how can I fix this problem?

    I have recently updated my iTunes to the latest software. Since then my iphone will not sync with itunes, it doesn't show up in my computer any more either. The computer makes the bing sound as I plug in but i am unable to sync, how can I fix this problem?

    http://support.apple.com/kb/TS1538

  • I want to know why some box of Iphone5s it's not come full accessories in box simple my iPhone 5s I have bought from Apple store last week it's first time for me use iPhone but so surprise me how the company make the phone have to use a pin to open

    I want to know why some box of Iphone5s it's not come full accessories in box simple my iPhone 5s I have bought from Apple store last week it's first time for me use iPhone but so surprise me how the company make the phone have to use a pin to open the sim but didn't give a pin inside the box and I ask staff at store their said they also don't know some box have some of are don't have a pin come together so then they told me I have to find solution or I have to buy a pin by my self I can buy it by myself but I really don't understand how come apple big company but how it's happen like this?thank you.

    Where did you purchase this. The US phones do not come with the SIM removal tool anymore. They haven't for some time now. I'm not even sure it comes with any of the devices anymore. You can just straighten out a paper clip and do the same thing.

  • My IPHONE will not Sync when plugged into the USB port, although the it makes the sound that it is charging, Itunes does not recognize that it is there, what should I do?

    I have restarted the computer, the IPHONE 4, I have checked for updates, and Have reinstalled Itunes.  The Iphone plugged into the usb makes the noise that its charging but nothing else. It does not sync and ITUNES does not recognize its plugged in.
    Please Assist.

    See also Recover your iTunes library from your iPod or iOS device.
    tt2

  • Why does the iPad make the same noise when it connects to a charger that doesn't charge it as one that will charge it???

    Why does the iPad make the same noise when it connects to a charger that doesn't charge it as one that will charge it???
    I would expect that it would make an unusual noise if plugged into a generic USB charger that does not have enough oomph to charge a pad to alert you - otherwise, you might think the noise is reassuring that you are actually charging it.

    I guess my question was actually more of a comment on the (lack of) design!  It is unusual that something like this would still be in an Apple product.  There are wall chargers that have a USB port on them that do not have the required oomph to charge the iPad.  I have one that has two USB ports, one for my iPhone  (it won't charge an iPad), and one for an iPad with greater amperage rating.  I accidentally used the wrong ones for a while yesterday, but noticed before being "surprised" the next morning by an uncharged iPad.  The iPad is smart enough to say "Not charging" by the battery icon when it is plugges in to one of these, so it "knows" - seems like it would be fairly simply to have the iPad make a different or additional noise  wehn it puts up the "Not charging" text icon.  Failsafe user experience?

  • Does compiling the kernel makes the system run significantly faster?

    It used to be when you compiled your kernel (at least ten years ago), you would get a significant speed boost. However, with the speed of machine nowadays, I wonder how much, if any. Does compiling the kernel have a significant increase in daily performance or otherwise? If so, what portion of the system does it makes faster than before? In short, Is it worth it? I appreciate any comments.

    lilsirecho wrote:
    Broch:
    The title of this thread doesn't limit responses to just redoing the kernel since it says "system run significantly faster".
    The kernel is not the system...the system runs from HDD and ram. 
    To speed up that process, run everything possible in ram for system speed up.
    I think for 500 packages loading from scratch to desktop in 45 seconds is fast.  And running after that in ram is super fast system speed "significantly faster".
    The speed I quote is possible now.  With UDMA capability in the kernel, at least half of the install time is probable.
    And that is for over 500 packages into KDE no less!
    Using flash in IDE removes the latent search from the system and therefore must be faster.
    Changing the kernel will indeed speed up the system...but only if it includes UDMA for the flash drives already available but not configured with the present kernels. 
    Using flash drives for ide cache repos will allow faster boot time, and reduce the load on the system.  You don't normally run many,many programs at once so put them in cache with a script to permit fast loading .
    That is "system running significantly faster" and all in ram, the fastest in the computer.
    no
    Does compiling the kernel makes the system run significantly faster?
    compiling kernel, not whatever
    I did not suspect that this requires explanation?
    but if you really want the noise, let's leave "faster?"
    and answer is: yes/no
    whatever that means.
    or you are joking
    anyway seems that results may vary.
    Last edited by broch (2008-02-06 04:32:01)

  • HT3281 Podcasts from Current Tv, since three weeks prior to the Nov 2012 election have had a url problem and cannot be played on my mac mini 2011 with 10.8.2 and the latest Itunes? anyone know why ? I am in contact with Itunes now and they wanted screensh

    Podcasts from Current Tv, since three weeks prior to the Nov 2012 election have had a url problem and cannot be played on my mac mini 2011 with 10.8.2 and the latest Itunes? anyone know why> ? I am in contact with Itunes now and they wanted screenshots of the problem, I can get these current tv episodes with a vpn and my isp says they are not blocking them, but i was surprised that prior to the election they were blocked, ?
    I also can get them on my Android Samsung Galaxy note 2 with no problem but on the Macmini cannot>/? I Unsubscribed and subscribed many times but still no luck, any ideas? I am waiting for the senior advisor to get back to me on this issue. I am in THailand now where the problem is happening and as I said the ISP says they do not block any podcasts.I also do not want it on my iphone 5, so I have to wait and see why the mac mini is not getting it.

    I seem to have fixed it by putting <div  class="clearfloat"></div> after the navigation bar?

  • Error The File "Print.ai" is in an unkown format and cannot be opened adobe Ilustrator 5.5

    I am getting an error The File "Print.ai" is in an unkown format and cannot be opened adobe Ilustrator 5.5 on Mac OX 10.10.2 but was also the same in Mac Mavericks. any thoughts?

    d,
    In addition to what Larry said, there is a number of levels you can try for general issues, described in the following list. 1) and 2) are the easy ones, 3) is the basic preference file (irreversible procedure), 4) is the whole preferences folder (reversible and more thorough, needed for some issues), 6) is the full ultimate solution, 5) can be skipped in this case.
    The following is a general list of things you may try when the issue is not in a specific file, and when it is not caused by issues with opening a file from external media, see below. You may have tried/done some of them already; 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    If possible/applicable, you should save current artwork first, of course.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to at least 5 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible), for CS3 - CC you may find the folder here:
    https://helpx.adobe.com/illustrator/kb/preference-file-location-illustrator.html
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall (ticking the box to delete the preferences), run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • The file '/foo.aspx' has not been pre-compiled, and cannot be requested

    Hi All
    I am using odp .net to access oracle data. I have also added oracle.dataaccess in my asp .net references. Everything works fine in my development and when I run the code through debugger. However, when I deploy the project in IIS, it gave me following error...
    "The file '/foo.aspx' has not been pre-compiled, and cannot be requested
    This is pretty generic error and I found out this is related to .Net assemblies.
    By further investigation, I found that oracle.dataacess.dll is not present in the bin directory of a deployed web site. I am not sure why .net is dropping that dll in the deployment wizard.
    Did anyone encounter this problem before?
    I got a workaround for now that manually copting dll into the bin directory of deplyed web site. However, I am looking for more robust and technical answer..
    The strange thing is I have been deploying the web site the same way for last 8 months and never encountered this problem.
    thanks a lot..
    Message was edited by:
    amazon

    If you add a reference to Oracle.DataAccess at design time it will be added as an assembly definition to web.config. Then you don't need a copy in your bin dir and it will be found in the GAC.
    Eric

  • Hi! Trying to save my document as a pdf, get the message that "this pdf is already open somewhere and cannot be saved". Whats wrong??

    Hi! When trying to save my document as a pdf, I get the message that "this pdf is already open somewhere and cannot be saved". I have not yet succeeded in saving it, and I've closed all preview windows of it, so it simply can't be open anywhere. Whats wrong??

    Correction on Question:
    This is a web application and the users need to be able to load the editable .pdf form from the website, edit it and submit it back to the website from within Internet Explorer.
    Users began getting the error message:
    'The document could not be saved. This file is already open.'
    last Friday after having no problems prior to this. Some users can edit the editable .pdf forms on the website and save the file with the same name to the website. Some get the error mentioned in the subject. 
    We really need help getting this resolved.
    Sandy Martin

  • When I sync my iPhone or iPad with I tunes, the music library appears on the device, but 95% of it is greyed out and cannot be played.  How can I fix this?

    When I sync my iPhone or iPad with I tunes, the music library appears on the device, but 95% of it is greyed out and cannot be played.  How can I fix this?

    kimberlyfromtopeka wrote:
    Ok,thanks but, I should be able to something so that I am able to sync the entire library again not just the purchased songs.
    If the non purchased music is not on your computer, how can it Sync to your iPhone...

  • Have personal Apple ID account which allows me to download apple apps but when I go to update the apps Apple ID pops up thats not mine and cannot log in to update apps.  Brand new IPAD never any other user

    Have personal Apple ID account which allows me to download apple apps but when I go to update the apps Apple ID pops up thats not mine and cannot log in to update apps.  Brand new IPAD never any other user

    Is the AppleID listed in Settings --> Store and Settings --> iCloud the same?
    If it is a totally different ID and not a slight variation of yours, I would definitely take it back to the store. You may have bought a returned item that had been setup previously.

Maybe you are looking for

  • Sub contract PO from sales order

    Hi, I want to create a sub cotract PO for material A from a sales order (a PR will be created from the sales order and linked to the sales order in VA01). The PO will have item category L and account assignment M. The issue with that is the component

  • Workflow 2010 set list item permissions

    I have a sharepoint 2013 list set up with two kinds of users (Approver and Employees) needing access: Approvers - need full control on the list/site Employees - can only have edit/read access to their own list item or entry I'm using SPD 2013 with wo

  • Blue Thinkvantage button

    Hi, I had to re-install windows and now the Blue Thinkvantage button is not working. What Lenovo softeware do i need to download to make this work again. W700 - Win 7 x64 Thanks, Kev

  • VAT  FX  and local currency  for UK

    Sales invoices that are not in the local currency still need to record the VAT amount in local currency, and this amount needs to appear in the VAT report. This is currently an issue with the UK VAT authorities.Can some one give me lead about this FX

  • Can the sequence pass/fail status be controlled in Test Stand?

    I have a sequence that contains a DoWhile loop. Within the loop are 5 or 6 steps that are executed. If the result of those steps is a fail the loop runs again until it passes or meets its allowable number of iterations. My problem is that if an itera