Bug 204040 - javascript / php marked as a error and wrong identation
javascript / php marked as a error and wrong identation
Status: RESOLVED INVALID
Product: php
Classification: Unclassified
Component: Editor
7.0.1
PC Windows Vista
: P3 (vote)
: 7.1
Assigned To: Petr Pisl
issues@php
: PLATFORM
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-20 20:51 UTC by montblack
Modified: 2011-10-21 11:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description montblack 2011-10-20 20:51:22 UTC
Product Version = NetBeans IDE 7.0.1 (Build 201109201739)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_25
Runtime = Java HotSpot(TM) Client VM 20.0-b11

i got this php code:

\\-----------------------------------------------------------------------------
<script type="text/javascript">
<?php include_once 'errorAdmin_res.php'; ?>
    function valid(data){
        try{
            var _msg = "";
            if (typeof data.val == "undefined"){
                data.val = $("#"+data.id).children("#val").val();
                if(typeof data.evento != "undefined" ){
                    evt = data.evento;
                    evt = (evt) ? evt : event; 
                    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0)); 
                    data.val += String.fromCharCode(charCode); 
                }
            }
            switch(data.tipo){
                default:
                    return "";
                    break;
<?php foreach ($metadatos as $key => $value) { ?> 
                        case '<?php echo $key; ?>':
    <?php if (!$value["null"]) { ?>
                                if (data.val == "") {
                                    _msg += "&#9737; El Campo no debe estar vacio<br/>";
                                }
    <?php } ?>
                            if (data.val != "") {
                                <php if (strlen($value["formato"][0]) > 0) {$a = 10;?><?php } ?>
                                                            if (!<?php echo $value["formato"][0]; ?>.test(data.val) && _msg=="") 
                                                            _msg += "&#9737; Formato Incorecto! <?php echo $value["formato"][1]; ?> <br/> ";
                                                        }
                                                        break; 
<?php } ?>
                    
                    }
                    if(_msg != ""){
                        printError({id: data.id, msg: _msg});
                        return false;
                    }else{
                        if($("#"+data.id).children("#err").length>0)
                            $("#"+data.id).children("#err").remove();
                        return true;
                    }
                }catch(e){
                    if(<?php echo $alertError; ?>) alert(e);
                }
            }
</script>
\\-------------------------------------------------------------------------------------
and ide mark many lines as a error but this is not an error and i press ALT+ENTER and dont show me any sugestion

pd: sorry gor my english i speak spanish
Comment 1 Petr Pisl 2011-10-21 11:16:58 UTC
I expect that the code is in a php file. I'm right?
Comment 2 Petr Pisl 2011-10-21 11:23:05 UTC
I have just noticed that there is missing question mark in one open php delimiter. When i correct it from:

<php if (strlen($value["formato"][0]) > 0) {$a = 10;?><?php } ?>

to 

<?php if (strlen($value["formato"][0]) > 0) {$a= 10;?><?php } ?>

then it start to work correctly. 

Please reopen, if it's not the reason. Thanks.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo