Results 1 to 4 of 4

Thread: Error: syntax error Line: 8 Source Code: )

  1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    15

    Default Error: syntax error Line: 8 Source Code: )

    My php GUI file is


    Code:
    <?php 
    include "kiadb_db.php";
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>Applicant Details</title>
        <link rel="stylesheet" type="text/css" href="../resources/css/ext-all.css"/>
        <script type="text/javascript" src="../Scripts/ext/adapter/ext/ext-base.js"></script>
     <script type="text/javascript" src="../Scripts/ext/ext-all-debug.js"></script>
     <script type="text/javascript" src="../Scripts/ext/ext-all.js"></script>
     <script type="text/javascript" src="../Scripts/ext/FileUploadField.js"></script>
     <script type="text/javascript" src="../demo.js"></script>
        
        <style type="text/css">
           p{
               width: 750px;
            }
            .ext-ie .x-form-check-wrap, .ext-gecko .x-form-check-wrap
            {
               padding-top: 3px;
            }
            fieldset legend 
            {
               white-space: nowrap;
            }
            .upload-icon
            {
                background: url('../Scripts/openLayers/img/image_add.png') no-repeat 0 0 !important;
            }
        </style>
     <script type="text/javascript">  
     Ext.onReady(function(){
      Ext.QuickTips.init();
        // turn on validation errors beside the field globally
        Ext.form.Field.prototype.msgTarget = 'side';
        var dist_global;
        var bd = Ext.getBody();
        var tal = new Ext.data.JsonStore({
            autoLoad:true,
         url: 'taluka_list.php',
         root: 'districtid', 
         fields: ['gid','district_c','taluka_cod','taluka_nam']
            })
        
           
        var vill = new Ext.data.JsonStore({
         autoLoad:true,
         url: 'village_list.php',
         root: 'districtid1', 
         fields: ['gid','taluka_cod','village_co','village_na']
            })
        
        var ianame = new Ext.data.JsonStore({
         autoLoad:true,
         url: 'app_ianame_list.php',
         root: 'districtid', 
         fields: ['gid','district_c','industrial','industria1']
            })
        var product = new Ext.data.JsonStore({
         url: 'ex_ind_product.php',
         root: 'products', 
         fields: ['id','products']
            })
        
        var status = new Ext.data.JsonStore({
         url: 'ex_ind_firmstatus.php',
         root: 'firmstatus', 
         fields: ['id','firm_status']
            })
      
        var relation = new Ext.data.JsonStore({
         url: 'ex_app_relate.php',
         root: 'aplrelation', 
         fields: ['id','app_relate_firm']
            })
        var district = new Ext.data.JsonStore({
         autoLoad:true,
         url: 'district_list.php',
         root: 'districtid', 
         fields: ['gid','district_c','district_n']
            })
        
        var top = new Ext.FormPanel({
         url:'applicant_details_php.php',
         autoScroll:true,
         renderTo: document.body,
      frame:true,
            title:'Applicant Details',
            bodyStyle:'padding:5px 5px',
            width: 250,
            items: [{
                layout:'column',
                border:false,
                labelWidth:200,
                lableAlign:'left',
                items:[{
                    columnWidth:.5,
                    layout: 'form',
                    width:140,
                    border:false,
                 items: [{
                        xtype:'textfield',
                        fieldLabel: 'Application Number ',
                        name: 'app_number',
                        value:'12345',
                        //anchor:'100%'
                        },{
                           xtype:'textfield',
                           fieldLabel: 'File Number ',
                           id: 'file_no',
                           name: 'file_no',
                           value:'A23451',
                          },
                            new Ext.form.ComboBox({
            fieldLabel:'District',
                     name: 'district',
                     id:'did',
                     emptyText: 'Select District',
                     valueField:'district_c',
                     displayField:'district_n',
                     tpl: '<tpl for="."><div ext:qtip="{district_n}" class="x-combo-list-item">{district_n}</div></tpl>',
                     allowBlank: false,
                     editable: false,
                     triggerAction: 'all',
                     typeAhead: true,
                     mode: 'remote',
                     store: district,
                     readOnly: false,
                     width:125,
                     listeners:{
           select:{
                      fn:function()
                      {
                      var dist=Ext.getCmp('did').getValue();
           dist_global=dist;
           Ext.getCmp('tid').clearValue();
                      Ext.getCmp('tid').store.load({
                      params: { 
                         filter: this.value, 
                         d_code:dist
                            }
                        });
                      }
            } 
          }
                       }),
                          new Ext.form.ComboBox({
              fieldLabel:'Taluka',
                       name: 'taluka',
                       id:'tid',
                       emptyText: 'Select Taluka',
                       valueField:'taluka_cod',
                       displayField:'taluka_nam',
                       allowBlank: false,
                       editable: false,
                       triggerAction: 'all',
                       typeAhead: true,
                       mode: 'remote',
                       store: tal,
                       readOnly: false,
                       width:125,
                       lastQuery:'',
                       listeners:{
                        select:{
                          fn:function()
                          {
                          var tcode=Ext.getCmp('tid').getValue();
                          Ext.getCmp('vid').clearValue();
                          Ext.getCmp('vid').store.load({
                          params:{ 
                             filter: this.value, 
                             t_code: tcode
                                  }
                           });
                          }
                } 
               }
                          }),
                          new Ext.form.ComboBox({
              fieldLabel:'Village',
                       name: 'village',
                       id:'vid',
                       emptyText: 'Select Village',
                       valueField:'village_co',
                       displayField:'village_na',
                       allowBlank: false,
                       editable: false,
                       triggerAction: 'all',
                       typeAhead: true,
                       mode: 'remote',
                       store: vill,
                       readOnly: false,
                       width:125,
                       lastQuery:'',
                       listeners:{
                        select:{
                          fn:function()
                          {
                          Ext.getCmp('iaid').clearValue();
                          alert(dist_global);
                          Ext.getCmp('iaid').store.load({
                          params:{ 
                             filter: this.value, 
                             distcode:dist_global
                                     }
                         });
                         }
                 } 
             }
                    }),
                       new Ext.form.ComboBox({
                        fieldLabel:'IA Name',
                   name: 'ia_code',
                   id:'iaid',
                   emptyText: 'Select Industrial Area',
                   valueField:'industrial',
                   displayField:'industria1',
                   allowBlank: false,
                   editable: false,
                   triggerAction: 'all',
                   typeAhead: true,
                   mode: 'remote',
                   store: ianame,
                   readOnly: false,
                   width:125,
                   lastQuery:''
                       }),{
                          xtype:'textfield',
                          fieldLabel: 'Initial Land Cost',
                          maskRe: /[0-9]/,
                          name: 'amount',
                          value:'100000',
                          //anchor:'90%'
                      },{
                          xtype:'textfield',
                          fieldLabel: 'EMD(20%)',
                          maskRe: /[0-9]/,
                          name: 'emd_amt',
                          value:'100000'
                          //anchor:'90%'
                      },{
                          xtype:'textfield',
                          fieldLabel: 'Name of Industry',
                          value:'Anitha Handlooms',
                          name: 'indname',
                          //anchor:'90%'
                      },
                new Ext.form.ComboBox({
         fieldLabel:'Products Manufactured',
                  name: 'product',
                  id:'product_id',
                  emptyText: 'Select Product',
                  valueField:'id',
                  displayField:'products',
                  editable: false,
                  triggerAction: 'all',
                  typeAhead: true,
                  mode: 'remote',
                  //width:125,
                  store: product,
                  readOnly: false,
                  //allowBlank:false,
                  selectOnFocus:true,
                  width:125,
                  //anchor:'100%'
                   }),
                   new Ext.form.ComboBox({
          fieldLabel:'Status of Firm',
                   name:'firmstatus',
                   id:'sid',
                   emptyText: 'Select Firm Status',
                   valueField:'firm_status',
                   displayField:'firm_status',
                   editable: false,
                   triggerAction: 'all',
                   typeAhead: true,
                   mode: 'remote',
                   store: status,
                   readOnly: false,
                   //allowBlank:false,
                   selectOnFocus:true,
                   width:125,
                   //anchor:'100%'
                    })
                     ,new Ext.form.ComboBox({
          fieldLabel:'Applicant relation to the Firm',
                   name:'aplrelation',
                   id:'aprid',
                   emptyText: 'Select Applicant Status',
                   valueField:'app_relate_firm',
                   displayField:'app_relate_firm',
                   editable: false,
                   triggerAction: 'all',
                   typeAhead: true,
                   mode: 'remote',
                   store: relation,
                   readOnly: false,
                   //allowBlank:false,
                   selectOnFocus:true,
                   width:125,
                   //anchor:'100%'
                   }),{
                          xtype: 'radiogroup',
                    fieldLabel: 'Documents Enclosed',
                    items: [
                        {boxLabel: 'Yes', name: 'rb-auto', inputValue: 1, checked: true},
                        {boxLabel: 'No', name: 'rb-auto', inputValue: 0}
                           ]
                     },{
                       xtype: 'fileuploadfield',
                    id: 'form-file1',
                    fieldLabel: 'Upload Document',
                    //value:'C:\\KIADB\\Allotment_docs\\docs.pdf',
                    name: 'Mach_doc',
               style: 'text-align: left',
                    buttonText: '',
                    width: 125,
                    //anchor:'100%',
                    buttonCfg: {
                        iconCls: 'upload-icon'
                         }
                    },{
                          xtype:'textfield',
                          fieldLabel: 'Applicant Name(in Capital Letters)',
                          name: 'app_name',
                          value:'ABCGD',
                          maskRe: /[A-Z]/,
                          //anchor:'100%'
                      },{
                          xtype:'datefield',
                          fieldLabel: 'Date',
                          value:'06/09/2010',
                          name: 'date',
                          //format:'d/m/Y'
                          //anchor:'100%'
                      },{
                          xtype:'textfield',
                          fieldLabel: 'Address (in Capital Letters)',
                          name: 'add1',
                          value:'ABCGD',
                          //maskRe: /[A-Z0-9]/,
                          //anchor:'100%'
                      },{
                          xtype:'textfield',
                          fieldLabel: 'Applicant Communication Address',
                          name: 'add2',
                          value:'ABCGD',
                          //maskRe: /[A-Za-z0-9]/,
                          //anchor:'100%'
                      },{
                          xtype:'textfield',
                          fieldLabel: 'Local Address at Bangalore (If any)',
                          name: 'loc_add',
                          value:'ABCGD',
                          //anchor:'100%'
                      }]
                   },{
                    columnWidth:.5,
                    layout: 'form',
                    width:125,
                    lableAlign:'right',
                    bodyStyle:'padding:0px 15px',
                    border:false,
                    items: [{
                        xtype:'textfield',
                        fieldLabel: 'Local Phone Number at Bangalore (If any)',
                        name: 'ph1',
                        value:'9875462',
                        maskRe: /[0-9]/,
                        //anchor:'100%'
                    },{
                        xtype:'textfield',
                        fieldLabel: 'Occupation',
                        name: 'occupation',
                        value:'ABCGD',
                        maskRe: /[A-Za-z]/,
                        //anchor:'100%'
                    },{
                        xtype:'textfield',
                        fieldLabel: 'Age',
                        name: 'age',
                        value:'65',
                        maskRe: /[0-9]/,
                        //anchor:'100%'
                    },{
                        xtype:'textfield',
                        fieldLabel: 'Qualification',
                        name: 'qualification',
                        value:'ABCGD',
                        maskRe: /[A-Za-z]/,
                        //anchor:'100%'
                       },{
                         xtype:'textfield',
                          fieldLabel: 'Category',
                          value:'ABCGD',
                         name: 'cat',
                         maskRe: /[A-Za-z]/,
                         //anchor:'100%'
                       },{
                              xtype:'textfield',
                              fieldLabel: 'Mention Community in case of BC/Minority',
                              name: 'community',
                              value:'ABCGD',
                              maskRe: /[A-Za-z]/,
                              //anchor:'100%'
                          },{
                              xtype:'textfield',
                              fieldLabel: 'Experience in Industrial Field',
                              maskRe: /[0-9]/,
                              value:'10',
                              name: 'exp_ind',
                              //anchor:'100%'
                          },{
                              xtype:'textfield',
                              fieldLabel: 'Financial Background',
                              name: 'fbg',
                              value:'ABCGD',
                              maskRe: /[A-Za-z]/,
                              //anchor:'100%'
                          },{
                              xtype:'textfield',
                              fieldLabel: 'Father/Husband Name',
                              name: 'foh_name',
                              value:'ABCGD',
                              maskRe: /[A-Z]/,
                              //anchor:'100%'
                          },{
                              xtype:'textfield',
                              fieldLabel: 'Father/Husband Occupation',
                              name: 'foh_occp',
                              value:'ABCGD',
                              //anchor:'100%'
                          },{
                            xtype: 'radiogroup',
                              fieldLabel: 'Domicile of Karnataka State',
                              id:'dom',
                              items: [
                                  {boxLabel: 'Yes', name: 'rb-auto1', inputValue: 1},
                                  {boxLabel: 'No', name: 'rb-auto1', inputValue: 0, checked: true}
                                     ]
                          },{
                           xtype: 'radiogroup',
                              fieldLabel: 'Applicant/Associated Companies which applied earliear for Land',
                              items: [
                                  {boxLabel: 'Yes', name: 'rb-auto2', inputValue: 1},
                                  {boxLabel: 'No', name: 'rb-auto2', inputValue: 0, checked: true}
                                     ]
                          },{
                              xtype:'textfield',
                              fieldLabel: 'If applied for land earlier,Furnish the details',
                              name: 'asso_comp_details',
                              value:'ABCGD',
                              //anchor:'100%'
                          },{
                           xtype: 'radiogroup',
                          fieldLabel: 'Applicant associated with other Companies which has been provided land',
                          items: [
                              {boxLabel: 'Yes', name: 'rb-auto3', inputValue: 1},
                              {boxLabel: 'No', name: 'rb-auto3', inputValue: 0, checked: true}
                              ]
                          },{
                              xtype:'textfield',
                              fieldLabel: 'If associated with any other company,Furnish the details',
                              name: 'asso_oth_comp_details',
                              value:'ABCGD',
                              //anchor:'100%'
                           },{
                             xtype: 'radiogroup',
                          fieldLabel: 'Type of Industry',
                          items: [
                              {id:'type', boxLabel: 'Fresh', name: 'rb-auto4', inputValue: 'FRESH' ,checked:true},
                              {id:'type1', boxLabel: 'Existing', name: 'rb-auto4', inputValue: 'EXE'}
                              ]
                          }]
                }]
            }], 
            buttons: [{
            text: 'Save & Continue',
            handler: function(){
         if(top.getForm().isValid()){
         top.getForm().submit({
         waitMsg: 'Inserting your record into database',
         success: function(top){
         Ext.MessageBox.alert('Creation OK','Applicant Details Saved Successfully');
         var file_no=Ext.getCmp('file_no').getValue();
         var product = Ext.getCmp('product_id').getValue(); 
         var a = Ext.getCmp('type').getValue(); 
            var b = Ext.getCmp('type1').getValue();
            var ia_code = Ext.getCmp('iaid').getValue();
      alert(file_no);
      if(a)
            {
        window.location='Details_of_Fresh_Industry.php?file_no='+escape(file_no)+'&ind_n='+escape(product)+'&ia_code='+escape(ia_code);
            }
            if(b)
            {
            window.location='Details_of_Existing_Industry.php?file_no='+escape(file_no)+'&ind_n='+escape(product);
            }
         },
         failure: function(top){
         Ext.MessageBox.alert('Warning','Records not Saved');
         }
         });
         }
         }
      },{
                text: 'Reset',
                handler: function()
                {
             top.getForm().reset();
             }
                },{
                text: 'Cancel'
                }]
           });
        var window1 = new Ext.Window({
            title:'Allotment Application Form',
            width: 780,
            height: 540,
            layout: 'fit',
            plain: true,
            items: top
            });
        window1.show();
        
    }); 
     
    
     </script>   
        
    </head>
    <body>
    </body>
    </html>


    and php file backend database entry is


    Code:
    <?php 
     //session_start();
     //$_SESSION['app_id']=$app_id;  //application id stored in session to pass into next page
     
     include "kiadb_db.php";
     
     $app_no=$_POST['app_number'];
     $file_no=$_POST['file_no'];
     $iacode=$_POST['ia_code'];
     
     $res=pg_exec($connection,"select industrial from industry where industria1='$iacode'");
     $ia_code=pg_result($res,0);
     
     $dist=$_POST['district'];
     $amt=$_POST['amount'];
     $indname=$_POST['indname'];
     $product=$_POST['product'];
     $firmstatus=$_POST['firmstatus'];
     $aplrelation=$_POST['aplrelation'];
     $doc_encd=$_POST['rb-auto'];
     $app_name=$_POST['app_name'];
     $date=$_POST['date'];
     $add1=$_POST['add1'];
     $add2=$_POST['add2'];
     $loc_add=$_POST['loc_add'];
     $ph1=$_POST['ph1'];
     $occp=$_POST['occupation'];
     $age=$_POST['age'];
     $qualifn=$_POST['qualification'];
     $cat=$_POST['cat'];
     $comnt=$_POST['community'];
     $exp_ind=$_POST['exp_ind'];
     $fbg=$_POST['fbg'];
     $foh_name=$_POST['foh_name'];
     $foh_occp=$_POST['foh_occp'];
     $dom=$_POST['rb-auto1'];
     $assocomp=$_POST['rb-auto2'];
     $assocompd=$_POST['asso_comp_details'];
     $assooth=$_POST['rb-auto3'];
     $assoothd=$_POST['asso_oth_comp_details'];
     $t_name=$_POST['taluka'];
     $v_name=$_POST['village'];
     
     $res=pg_exec($connection,"select taluka_cod from taluka where taluka_nam='$t_name'");
     $taluka=pg_result($res,0);
     
     $res=pg_exec($connection,"select village_co from villagebound where village_na='$v_name'");
     $village=pg_result($res,0);
      
    // $hno="SELECT * from allot_applicant_details where application_no='$app_no' or file_no='$file_no'";
    //  
    // $result=pg_exec($connection,$hno);
    // $count=pg_num_rows($result);
    // if($count==0)
    // {
     $sql = "INSERT INTO allot_applicant_details(application_no,file_no,ia_code,category,district_n,amount,industry_name,product,firm_status,app_relation_firm,enclosures,app_name,entry_date,add1,add2,loc_add,loc_phone,occupation,age,qualification,community,exp_ind_field,finance_bg,father_name,father_occupation,domicile_ka,asc_comp_apld,asc_comp_info,asc_othcomp_apld,asc_othcomp_info,taluka_cod,village_co) 
     VALUES ('$app_no','$file_no',$ia_code,'$cat','$dist','$amt','$indname','$product','$firmstatus','$aplrelation','$doc_encd','$app_name','$date','$add1','$add2','$loc_add','$ph1','$occp','$age','$qualifn','$comnt','$exp_ind','$fbg','$foh_name','$foh_occp','$dom','$assocomp','$assocompd','$assooth','$assoothd','$taluka','$village')";
     $result=pg_exec($connection,$sql);
     
    // Echo '{success:true}';
    // }
    // else
    // {
    // Echo '{failure:true}';
    // }
    ?>

    i am getting this error

    Error: syntax errorSource File: http://localhost:8085/kiadb1/Scripts/ext/ext-all.jsLine: 8Source CodeAny help is greatly Appreciated
    Thanks

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    1. Don't include both ext-all.js and ext-all-debug.js. Use ext-all-debug.js for testing and ext-all.js (or your own build) for production.
    2. Run your code through jslint.com (you have loads of trailing commas).

  3. #3
    Sencha User
    Join Date
    May 2010
    Posts
    15

    Default how to run on jslint.com

    how to run code in jslint.com

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    Copy & paste your javascript code to jslint.com and fix all warnings.

Similar Threads

  1. Replies: 3
    Last Post: 29 Aug 2009, 5:31 AM
  2. Error on submitting form (Syntax error () line 7389)
    By bisounux in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 20 Aug 2009, 2:12 PM
  3. Replies: 1
    Last Post: 23 Feb 2009, 8:35 AM
  4. Mixed line endings in source code
    By jweber in forum Community Discussion
    Replies: 4
    Last Post: 4 May 2008, 10:40 PM
  5. Error with the submit form sintax error ( ) ext-all.js (line 38)
    By nunez in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 12 Aug 2007, 7:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •