Posts

Showing posts from July, 2012

database - MySQL IN Clause in SQL query with User Defined Function -

i using following query update children of particular topic. update topics set reuse = 0 topic_id in (select getchildtopics(187)); where select getchildtopics(187); returns "188,190,189" update query updating first row topic_id = 188, instead of updating first topic only, should update 3 topics. when put values manually works fine. update topics set reuse = 0 topic_id in (188,190,189); can suggest what's wrong doing here? here code getchildtopics mysql function create definer=`root`@`localhost` function `getancestry`(givenid int) returns varchar(1024) charset latin1 deterministic begin declare rv varchar(1024); declare cm char(1); declare ch int; set rv = ''; set cm = ''; set ch = givenid; while ch > 0 select ifnull(parent_topic_id,-1) ch (select parent_topic_id topic_list id = ch) a; if ch > 0 set rv = concat(rv,cm,ch); set cm = ','; ...

Java - executing external exe file -

i have executable program made on c++ (cf.exe) takes parameters few text files (.txt), performs calculations, , creates file results (results.txt). program needs no interaction. once executed, when calculations done, it's automatically closed. then, have other program made on java, contains button executes cf.exe. when button pressed following method called: public void executeexternalprogram(){ string filepath = "c++" + file.separator + "cf.exe"; try { system.out.println("executing c++ exe..."); process p = runtime.getruntime().exec(filepath);; } catch (exception e) { e.printstacktrace(); } } i don't error, cf.exe not being executed when press button. when execute manually cf.exe, results file correctly created. furthermore, i've tried copy other programs, such notepad.exe, same folder , execute through java without problem...

c++ - Boost.Asio: Segmentation fault when sending too big message -

my program saves internal logs .txt file. if connect via tcp (ssl encrypted), program send contents of log file. this code sending data: void niusersession::write(std::string message) { std::cout << "writing message" << std::endl; message.append("<eof>"); boost::system::error_code ec; boost::asio::async_write(this->socket_, boost::asio::buffer(message), boost::asio::transfer_all(), boost::bind(&niusersession::writehandler, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred())); } void niusersession::writehandler(const boost::system::error_code &error, std::size_t bytes_transferred) { std::cout << "write handler" << std::endl; if(error) { std::cout << "write handler error: "...

mysql - Monitoring : Centreon - How to connect centreon user to database? -

i'm running centreon entreprise server (ces) 3.3 , added nagvis (1.8.x). on virtual machine (virtualbox). when suceeded in giving rights nagvis reach centreon data, centreon started displaying : "database error: not connect database", though the centreon user has privileges on "centreon" , "centreon_storage" . here's central-broker-master.log : [1467987167] error: storage: rebuilder: not connect centreon storage database: not open database: access denied user 'centreon'@'localhost' (using password: yes) qmysql: unable connect [1467988484] error: tcp: error while sending data peer 'localhost:5670': remote host closed connection [1467988492] config: module applier: loading directory '/usr/share/centreon/lib/centreon-broker' [1467988492] config: correlation: invalid correlation configuration, correlation engine not loaded [1467988492] config: applier: 14 modules loaded [1467988492] error: not open database: ac...

php - MySql what's the best way to insert bookings -

Image
i have database looks this i wondering separate tables , such, insert 1 table @ time, insert row in booking, insert row in customers, , last insert row in booking_has_customers? there easier way this? halls unchanging in case have more rooms hire. and when retrieving data database, best use join on foreign keys full overview incase need data? thanks in advance! no there no easier way, need insert data each table individually. however, exact situation asks transactions . transactions ensure either required insertions happen, or none of them. this question pretty broad , cannot answered. if makes sense retrieve data multiple tables, joins answer , foreign keys starting points join condition. join condition may have contain expressions beyond foreign keys. depends actual use case. i rather ask specific questions specific use cases reports / queries in separate questions. way can answers tailored exact question.

ios - How to record landscape video in a portrait application? (Swift 2, iPhone) -

i need record landscape video inside portrait iphone application. is possible or blocked hardware limitation? using avcapturevideopreviewlayer able change preview orientation, video still recorded in portrait. any idea welcomed! you should able set orientation landscape video recording. , set preview layer portrait achieve landscape video previewed in portrait. if understand question correctly. can show code tried already? if capturesession.canaddoutput(videooutput) { capturesession.addoutput(videooutput) let connection = videooutput.connectionwithmediatype(avmediatypevideo) if connection.supportsvideoorientation { connection.videoorientation = avcapturevideoorientation.landscaperight } print("adding output") } else { print("could not add front video output") return } ... func setuppreviewlayer() { ...et...

php - Cakephp 2.X doesn't support postgresql ltree operator '?' likes "ltree ? lquery[]" -

i use postgresql ltree in cakephp 2.x controller , found when use query below: $this->userinfo->query( 'select * user_infos path ? \'{'test1.1','test2.1'}\'' ); it can execute through psql. format due ltree ? lquery[] it throw error: error: sqlstate[42601]: syntax error: 7 error: syntax error @ or near "[" line 1: ...t * user_infos where path $1 \'{'test1.1 ... ^ it seems pdo treats ? $1 argument? anyone has idea prevent problem?

SQL insert statement with carriage return or line feed -

i have question on sql insert statement. looking way insert string carriage return or line feed. for example, if run code: insert table (description) values ('this description' , 'updated description.') but not possible in sql there error. if there string like: this description. updated description. how insert carriage return , line feed remains? is there ways it? or need replaced system identifiable character? thanks help. to insert string asking for, do: insert table (description) values ('this description. updated description.'); if have disregard example , guess asking, (depending on rdbms-provider, guess mssql): insert table (description) values ('this description.' || chr(13)|| chr(10) || 'updated description.');

html - Extracting data from li tag under ul using Selenium Webdriver -

<ul class="dropdown-menu" aria-labelledby="dlabel"> <li><a href="resource/guide/tcs health insurance - hospitalisation claim reimbursement guidelines.pdf" target="_blank">hospitalization guide</a></li> <li><a href="resource/guide/tcs helath insurance - domiciliary claim reimbursement guidelines.pdf" target="_blank">domiciliary guide</a></li> </ul> i trying data under each li list not able extract value domiciliary guide above li list. in below code, list of elements displayed elements first list element, ele.gettext() not giving output. can me in extracting data li ? webelement ul=testdriver.findelement(by.xpath("//*[@id='header']/div/div/ul[1]/li[5]/div/ul")); list<webelement> elements=ul.findelements(by.tagname("li")); system.out.println("elements::"+elements); for(webelement e...

html - How to fetch value from one input into another? -

hi want fetch input value buyer_name copied buyer_name input field.i tried many ways unable find solution if knows solution please me.... my plunk controller:- $('#supname').change(function() { $('#supnamecopy').val($(this).val()); }); html:- <label for="quantity">quantity</label> <input type="text" ng-model="state.quantity" id="quantity" typeahead="state state.quantity state in states | filter: $viewvalue"> <label for="quantity">buyer_name</label> <input type="text" id="supname" ng-model="state.quantity" typeahead="state.buyer_name state in states | filter: $viewvalue"> <label for="quantitycopy">copied buyer_name</label> <input type="text" name="supnamecopy" id="supnamecopy" ng-model="copied"> my data:- $scope.states = [{...

How to delay the disappearance of splash screen and parallelly run a webservice in background in iOS objective C? -

i have integrated branch.io( https://branch.io/ ) in app deep linking. here response getting in branch handler has slight delay. once response other processing , decide whether navigate first screen or second screen. the problem before getting branch response, first screen displayed. want delay splash screen while (which not of people not have option probably). referred various links, how can display splash screen longer on iphone? suggest add splash view. not working. donot know reason. used [nsthread sleepfortimeinterval:6.0]; blocks main thread. used gcd didn't help. in didfinishlaunchingwithoptions, have coded, dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, null), ^{ dispatch_async(dispatch_get_main_queue(), ^{ //get branch response }); }); but first screen appearing before getting response branch.io. kindly help.... major problem in app without cannot test anything.. please me... let me know if have not...

Excel Advanced Filter the most recent date -

Image
i have data set like: id dc1 date 1 sth1 2015-01-01 1 sth2 2016-01-01 1 sth3 2012-01-01 2 sth2 2014-01-01 2 sth3 2012-01-01 and take recent record each id. id dc1 date 1 sth2 2016-01-01 2 sth2 2014-01-01 is there advanced filter option facilitates or have write function? you first sort data id , date descending , remove duplicates. of couse, if need keep data should copy data set new sheet or before doing :) sort remove duplicates result

javascript - Filter the nested array based on condition -

i have object this: runs = { "suites": [ { "status": "fail", "testcases": [ { "status": "pass" }, { "status": "fail" } ] }, { "status": "pass", "testcases": [ { "status": "pass" } ] } ] } i retrieve count of test case pass , fail (in above case pass: 2, fail: 1). tried following pass count: runs.suites.filter(suite => { suite.testcases.filter(testcase => { return testcase.status === 'pass'; }) }).length but giving me incorrect result. try this // code ...

javascript - Set ajax call only when the new record inserted to database -

i wants updated comment chat list page without refreshing page, thats have used ajax call list have call function every 5 seconds check whether new chat inserted or not database, $(document).ready(function(){ setinterval(function(){ $.ajax({ type:'post', url: baseurl+"chat", cache: false, data: datastring, crossdomain: true, success: function(data){ var getdata = json.parse(data); if(getdata.status == "success") { for(i=0;i<getdata.chat.length) { $("chatlist").text(""); $("chatlist").append("<span class='black'>"+getdata["chat"][i].name+" : <span class='blue'>"+getdata["chat"][i].comment+"</span>"); ...

vb.net - Create Excel array based on search function -

i've got list in excel shows titles in column , values in column b, this: article_posno 1 article_artno 111123 article_description black pens article_posno 2 article_artno 280708 article_description yellow paper article_posno 3 article_artno 999912 article_description blue scissors what i'm trying build vb function creates array holds values, can print this: pos art no description 1 111123 black pens 2 280708 yellow paper 3 999912 blue scissors below current script searches titles -> gets values next them , send msgbox of value. list, mean 9 msgboxes. ideally, show 1 messagebox article information on it. any ideas? many in advance! sub findarticles() dim firstaddress string dim mysearch variant dim rng range dim long mysearch = array("article_posno", "article_artno", "article_description") sheets("sheet1").range("a1:a1000") ...

javascript - svg-insertAdjacentHTML is not working on firefox version 35 and below? -

Image
i'm trying draw line using svg. used insertadjacenthtml . working on chrome not working in firefox. my html code follow <div style="height:330px; width:1100px; background:#313131; margin:0 auto; "> <svg id='svg_main' height="330" width="1100"></svg> </div> my javascript follow var svgid = document.getelementbyid('svg_main'); var str_lne = 60; var data = '<path id="lineab" d="m 50 '+str_lne+' l 1050 '+(str_lne)+'" transform="translate(0.5,0.5)" stroke="#707073" fill="none" storke-width="1px" opacity="1" ></path>'; svgid.insertadjacenthtml('beforeend',data); it doesn't run localhost on firefox(below 35). for example, i open firefox , enter url (localhost/svgtest.html) svg line not showing. but, save page ctrl+s , open firefox shows line. please me out problem , clarify re...

cefsharp - How to Act as Internet Explorer -

i using cefsharp in windows forms application. somehow sites need run on internet explorer only. how can set cefsharp (chromium) act internet explorer? i changed request headers set user-agent "mozilla/4.0 (compatible; msie 6.0; windows nt 5.0; windows nt 7.0; infopath.3; .net clr 3.1.40767; trident/6.0; en-in)" bu did not solve problem. site still gets browser not ie. could please provide solution? thanks further help i found solution faking site adding missing property/funcs document object in frameloadstart event this. private void browser_frameloadstart(object sender, frameloadstarteventargs e) { browser.evaluatescriptasync(@"if(!document.all) { document.all = {};} if(!document.compatmode) { document.compatmode = 'backcompat'} if(!document.getelementsbytagname){ document.getelementsbytagname = function(){}; } "); }

javascript - Is there any chance to get a button with double clicked after disabling it with one click? -

getting confusion button clicks in html page.i have set function button id avoid double clicks.double clicks causes double entries in database.it works fine now.but today again got 1 double entry in database.i unable find reason getting issue.there no errors in java class , jquery.please me in finding solution.for in advance. my jquery code is: $(function() { $('#timesheetform').submit(function(){ $("input[type='submit']", this).val("please wait...") .attr('disabled', 'disabled'); settimeout('$("#btnsubmitintimesheet").removeattr("disabled")', 1500); $("input[type='submit']", this).val("submit") return true; }); }); java method: public static result save(long storeid) { system.out.println("inside save method==========="); store store = store.find.byid(storeid); long empid = long.parselong(form().bindfromrequest().get("emp...

javascript - History is not saving in the same component, with different route parameters, in React JS -

i working on react js application windows mobile. route configuration below <route path='/' component={app} > <indexredirect to='/shows/1' /> <route path='shows/:id' onenter={bootstrap} component={showspage} /> <route path='settings' component={settings} /> <route path='devices' component={devices} /> </route> i have 3 tabs in first route urls shows/1 shows/2 shows/3 i using react-router , tabs tabs like <li key={tab}> <link to={`/shows/${tab}`} classname={classes.tabs} activeclassname={classes.active}>{tab}</link> </li> how navigating? when run application, first page shows/1 , if tap on second tab, route shows/2 . what's happening in browser? when run application in browser, can see shows/1 , if click on second tab can see url changing shows/2 . here when click browser button navigating shows/1. , when go settings page shows/2 , click on browser but...

add in - Get Current rows cells values one by one on "BindingSelectionChanged" event from table in html form in Word using office.js -

hello creating application using office.js used in excel , word application addin , have written code gives text of entire row cell cell. requirement maintain styles , of every cell , store them in database when again addin runs should load data in same format stored. text getting in response. have asked similar question text styles current cell works great. how formatting current cell of table in word using office.js there thing if possible cell html row , column position solve problem. thank you! hi found solution of problem solution word not working in excel working me writing here :- function addtable() { var document = office.context.document; var headers = [["cities"]]; var rows = [['<b>hello there</b> <ul><li>one</li><li>two</li></ul>'], ['roma'], ['tokyo'], ['seattle']]; var html = '<table>'; html += '<thead>'; (var = ...

java - How can I access the property value of a running Thread -

i have thread run long time (5-6 min). public class exportthread implements runnable { private integer totalexport = 0; @override public void run() { try { exportcorner(); } catch (exception e) { e.printstacktrace(); } } private void exportcorner() { list<myobject> list = ...... for(myobject o : list){ ....... totalexport++; } } } this thread runs class. how can totalexport again , again after small interval ? simply adding getters thread class, @romankonoval said need synchronized public class exportthread implements runnable { private integer totalexport = 0; @override public void run() { try { exportcorner(); } catch (exception e) { e.printstacktrace(); } } private void exportcorner() { list<integer> list = ...... for(integer : list){ ...

python - Tensorflow TypeError on session.run arguments/output -

i'm training cnn quite similar 1 in this example, image segmentation. images 1500x1500x1, , labels of same size. after defining cnn structure, , in launching session in code sample: (conv_net_test.py) with tf.session() sess: sess.run(init) summ = tf.train.summarywriter('/tmp/logdir/', sess.graph_def) step = 1 print ("import data, read read_data_sets()...") #data defined me, returns dataset object testing , training images , labels segmentation problem. data = import_data_test.read_data_sets('dataset') # keep training until reach max iterations while step * batch_size < training_iters: batch_x, batch_y = data.train.next_batch(batch_size) print ("running backprop step %d" % step) batch_x = batch_x.reshape(batch_size, n_input, n_input, n_channels) batch_y = batch_y.reshape(batch_size, n_input, n_input, n_channels) batch_y = np.int64(batch_y) sess.run(optimizer, feed_dict={x: batch_x, y: batch_y, keep_prob: dropo...

AngularJS two-way data binding not working properly in directive -

i trying implement radio-button list using ng-repeat. typelist.html <div ng-repeat="type in types" > <input type="radio" id={{type.id}} name="{{type.name}}" ng-model="result" ng-value="type.id" > {{type.name}} <div> result {{result}} </div> //result changing in row of clicked radio-button. should change in every row.(two way data-binding). </div> directive: angular.module('app').directive('mylist',function(){ return{ restrict: 'a', scope: { types: '=', //here list passed printed ng-repeat result: '=' //here want store radio-button selected last time id }, templateurl: 'html/typelist.html' }; }); directive has isolated scope. passing 2 parameters. list printed radio buttons , result object stores answer(id-what radio button clicked ...

android - Make RecyclerView height dynamic by wrapping specific number of it's child(not all child) -

i want make recyclerview height wrap specific number of it's child views. made work using custom layoutmanager: public class wraptoitemcountlinearlayoutmanager extends android.support.v7.widget.linearlayoutmanager { public int numberofchild = 0; private static boolean canmakeinsetsdirty = true; private static field insetsdirtyfield = null; private static final int child_width = 0; private static final int child_height = 1; private static final int default_child_size = 100; private final int[] childdimensions = new int[2]; private final recyclerview view; private int childsize = default_child_size; private boolean haschildsize; private int overscrollmode = viewcompat.over_scroll_always; private final rect tmprect = new rect(); @suppresswarnings("unuseddeclaration") public wraptoitemcountlinearlayoutmanager(context context) { super(context); this.view = null; } @suppresswarnings("unuseddeclaration") public wraptoitemcountlinearlayoutmanager(co...

php - Flatten multidimensional array not working -

i have 2 arrays following. $alerts_array=array(1) { [0]=> array(11) { ["customalertsid"]=> int(3) ["customalerts_name"]=> string(10) "title demo" ["customalerts_publishdate"]=> string(10) "2016-07-03" ["customalerts_expirydate"]=> string(10) "2016-07-21" } } $singlebtn_array =array(3) { ["button_text0"]=> string(16) "button name1only" ["button_text1"]=> string(12) "button name2" ["button_text2"]=> string(16) "button name3_new" } i have merged 2 arrays single multidimensional array looks following $alerts_array = array_merge($alerts_array,$singlebtn_array); array(4) { [0]=> array(11) { ["customalertsid"]=>...

javascript - ionic Bind maxlength dynamically ionic2 -

my requirement bind maxlength ion-input . have tried using interpolation concept bind. my html <ion-list > <ion-item *ngfor=" let of arr_label"> <ion-label floating>{{a.lblname}}</ion-label> <ion-input maxlength={{a.maxlent}} [(ngmodel)]="a.val" type="text"></ion-input> </ion-item> .ts arr_label:any[]=[]; this.arr_label.push({maxlent:10}); is there missing... quite appreciable. you can bind attributes in 3 different ways bind directly it, if it's native attribute: <ion-input [maxlength]="a.maxlent" [(ngmodel)]="a.val" type="text"></ion-input> bind attr prefix - works on custom , native attributes: <ion-input [attr.maxlength]="a.maxlent" [(ngmodel)]="a.val" type="text"></ion-input> or set value interpolated string value of variable: <ion-input maxlength=...

eclipse - Spring Tool Suite: NullpointerException at "Push In" operation -

i used spring tool suite spring roo reverse engineer database. want remove aspectj files project , obtain standard javaee classes. so, did right click on project --> refactor --> push in... after this, error box saying multiple problems have occurred (java.lang.nullpointerexception). spring tool suite freezes , have close task manager. in error log found following error on , on again, seems occur every 20 milliseconds. occurs when select few classes , not whole project. appreciate, if me solving problem. here exception logfile: !message problems occurred when invoking code plug-in: "org.eclipse.jface". !stack 0 java.lang.nullpointerexception @ org.eclipse.ajdt.internal.ui.refactoring.pushinrefactoringinputpage$3.update(pushinrefactoringinputpage.java:314) @ org.eclipse.jface.viewers.viewercolumn.refresh(viewercolumn.java:141) @ org.eclipse.jface.viewers.abstracttableviewer.doupdateitem(abstracttableviewer.java:382) @ org.eclipse.jface.viewers.s...

botframework - How to resolve the error as “500 internal server error” in Bot Framework Channel Emulator? -

i working on bot framework technology, microsoft announced new version (v3) of bot. developed bots using old version, trying upgrade bots newer version. working fine after published bot azure, using publish url trying test in bot framework channel emulator (3.0.0.54) gives "500, internal server error". when added skype channel bot working fine. only problem when testing in bot framework channel emulator published url of bot application, got error "internal server error". i think there may problem latest version bot framework channel emulator please download file https://ngrok.com/download unzip file , use command prompt run below command ngrok http -host-header=rewrite 9000 screenshot as seen in screenshot copy forwarding url https , paste in emulator url emulator port should in 9000 , emulator url should contain ngrok forwarding https url note :ngrok should in running state .if getting same 500 error while trying next time p...

excel - Copy cells formulas VBA -

i did program in vba copy formulas in each cell in specific column, have 30501 points , program slow calculate 100 points, there better way so? sub copyformulas() dim integer dim cell range dim referencerange range dim string = "$t$30510" set range1= activesheet.range("a1:a30510") set myrange = range("t16:t30510") = 16 until cells(20, 30510) range1 each cell in myrange if cell.hasformula cells(i, 35).value = cell.address cells(i, 36).value = "'" & cstr(cell.formula) = + 1 end if next end loop end sub try adding following: application.calculation = xlcalculationmanual application.screenupdating = false application.enableevents = false ... code ... application.calculation = xlcalculationautomatic application.screenupdating = true application.enableevents = true you may need first one, practice in using. also, using with ....

Writing Firebase database rules when user information are on another server -

i need implement chatting mobile app talks own server, registered user information on own server. so, if use firebase real-time database chatting, how write security rules these: ".read": "auth != null", ".write": "auth != null" so scenario is, user's information on own server, in own database. want use firebase implement chat how write database rules prevents reading messages database (by hitting url maybe ?) yours precisely scenario firebase custom authentication made for. on server authenticate user against own user database, mint json web token information user want firebase know. @ least token should contain uid , may contain more information can access in security rules. once you've created jwt, return user. in app, use jwt sign in firebase. example on android means, you'll call firebaseauth.signinwithcustomtoken() method . for more information see firebase database server documentation .

android - Dataset entry are longer than x axis in MpAndroid chart? -

am trying create barchart (grouped datasets) chart using mpandroid chart while setting values using real time data sqlite whenver fetch data webservice , trying set value chart getting error dataset entry longer x axis values of chartdata object here code: import android.database.cursor; import android.graphics.color; import android.os.bundle; import android.support.v4.app.fragment; import android.support.v4.app.loadermanager; import android.support.v4.content.cursorloader; import android.support.v4.content.loader; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import com.android.volley.requestqueue; import com.github.mikephil.charting.charts.barchart; import com.github.mikephil.charting.data.bardata; import com.github.mikephil.charting.data.bardataset; import com.github.mikephil.charting.data.barentry; import com.github.mikephil.charting.interfaces.datasets.ibardataset; import java.util.arraylist; import j...

divide - SQL - test if numeric field is holding an integer -

i have numbers (from select) col1 col2 1. 3.6 , 3 2. 3.6 , 5 i want this if(col1/col2 = integer) update column else(col1/col2 = decimal number) update column any idea how number integer or decimal? you use modulo 1 (% 1), , if remainder 0 have 'integer'. example, sql server: if (col1 / col2 ) % 1 = 0 -- integer else -- decimal

how can i adjust gridview header ? asp.net c# -

Image
i have gridview contains edititemtemplate , itemtemplate gridview header not adjusting.how can adjust gridview header . here gridview here aspx.cs code : <asp:gridview id="gridview1" runat="server" autogeneratecolumns="false" enableviewstate="false" width="1000px" cellpadding="2" forecolor="#333333" allowpaging="true" height="400px" datakeynames="user_id" onrowcancelingedit="gridview1_rowcancelingedit" onrowdeleting="gridview1_rowdeleting" onrowediting="gridview1_rowediting" onrowupdated="gridview1_rowupdated" onrowupdating="gridview1_rowupdating" > <columns> <asp:templatefield accessibleheadertext="user_id" headertext="user_id"> <edititemtemplate> <asp:textbox id="txt_id" runat="ser...

facebook - Send to Messenger button not showing -

i trying use send messenger plugin not rendered if try initialize fb user's page id , messenger app id. user has given me permission manage pages obtain page id 1 of them (he chooses which). there nothing in messenger docs scenario.. here how it: flow: the user logs in using facebook login facebook sdk. gives me manage_pages permission. i fetch pages fb.api('/me/accounts') , display them user user selects 1 of these pages i create send messenger plugin element selected page id , app id, call fb.xfbml.parse() render plugin. not work if page not connected app seems. my messenger bot not published (still in development). things tried no results: - tried test users created in app - tried giving user tester role in app's settings code: <html> <body> <script> // if user logged in fb pages function statuschangecallback(response) { if (response.status === 'connected') { fetchpages()...

ajax - How can i call function in submithandler using jquery validation? -

i'm trying call ajax function once form validate not work me. below jquery on-submit method working fine me. $('#promotionadd').on('submit',(function(e) { e.preventdefault(); var formdata = new formdata(this); promotionadd(formdata); return false; })); but need call same thing in submithandler not work. $(document).ready(function () { $('#promotionadd').validate({ // initialize plugin rules: { mtitle: { required: true, minlength: 3, } }, messages: { mtitle: "please enter promotion title", }, submithandler: function (form) { // demo //alert(this); e.preventdefault(); var formdata = new formdata(this); promotionadd(formdata); return false; } }); })...