w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How can I change shortcut keys dynamically in form application?
Here is something that might help, I know it isn't the best way to do but I can't do any better. string ii = ""; protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.Control | Keys.C) && ii == "C") { MessageBox.Show("Your shortcut key is: C!!"); } return base.ProcessCmdKey(ref msg, keyData); } private void comboBox1_TextChanged(object sender, EventArgs e) { ii = comboBox1.Text; } Your comboBox1 is the ComboBox That contains your shortcut key options. That might help some, you will have to add a bunch of if statements. Hope this helps!!

Categories : C#

Change a form select from multiple to flat dynamically
WordPress ships with jQuery, so (inside document.ready): $('select').each(function() { if ( $(this).attr('name') == "bebida[]" && $(this).attr('class') == "bebida" ) { $(this).removeAttr('multiple'); } }); Syntax probably isn't dead on, but you get the idea.

Categories : Javascript

Input form with .change on drop down selector with dynamically created selections not working properly
This is Happening because of the below line $('.vehicleData').each(function (index) { if (index !== 0) $(this).remove(); }); on change event,above line removes 2nd and 3rd vehicle (if they are present) Now for use case when user changes no of vehicles from 3 to 2 then above line will remove second vehicle as well which you do not want. to make it work ,you should change your if condition as if (index > (total-1)) $(this).remove(); and also change the for loop condition as for (var i = ($('.vehicleData').length+1); i <= total; i++)

Categories : Jquery

Keep track of screen change and screen resolution change in Windows Form Application to change form size
Resolution change event Code snippet (untested) public void SubscribeEvents() { SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged); } public void SystemEvents_DisplaySettingsChanged(object sender, EventArgs e) { // Get the current resolution // Alter form size accordingly }

Categories : C#

dynamically load contents on IOS 5 application
Here's a tutorial you might find useful: http://blog.austinlouden.com/post/47644627216/your-first-ios-app-100-programmatically It's a 2 part tutorial showing how to add content programmatically. Here's an example: // create a button object UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; // attach a method 'buttonPressed' when the button is pressed. [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchDown]; // set the text shown on the button [button setTitle:@"buttonTitle" forState:UIControlStateNormal]; // set the size of the button button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0); // add the button to your view [view addSubview:button];

Categories : IOS

How to control the CSS of the contents that loaded dynamically into iframe?
There are a couple of problems there. The main problem is that you're running into the Same Origin Policy. You don't have script access to the content of a frame from a different origin than the page your script is running in. If the frame's content were from the same origin, You'd want to wait for the load event on the frame's content. Example: Live Copy | Live Source var frame = $("<iframe>"); frame.load(frameLoaded); frame.attr("src", "http://jsbin.com/inanin/1"); frame.appendTo(document.body); function frameLoaded() { frame.contents().find("img").hide(); } But again, the main problem is the SOP.

Categories : Jquery

Saving and storing the contents of a Panel dynamically
I made a similar kind of project before and I created two dictionaries to hold all the data // Dictionary which Holds all the Info for the shapes in a Particular Slide Dictionary<Int32, ShapeInfo> slideInfoDict = new Dictionary<Int32, ShapeInfo>(); // Dictionary which Holds all the Info for the all the shapes in the all the slides Dictionary<Int32, SlideInfo> appInfoDict = new Dictionary<Int32, SlideInfo>(); My "ShapeInfo" class has all the information about various shapes (Table, Rect, Image etc) The key (Int32) of this shapeInfoDict was the selected shape. Class "SlideInfo" holds all the information about that particular slide. The key (Int32) of this slideInfoDict was selected Slide. Hope that Helps.

Categories : C#

display model contents dynamically in View MVC4
One more idea. You may use jQuery to hide and callback function to $Post to your Delete ActionResult. For examp: (here I created easy example without $post: jsfiddle) <script> $('.delete').click(function() { $(this).closest('tr').hide(callback); function callback() { $post(/Home/Delete/.... }); </script> <table> <tr> <td>Marry</td> <td>10 points</td> <td><a class="delete" href="#">Delete</a></td> </tr> <tr> <td>Jane</td> <td>8 points</td> <td><a class="delete" href="#">Delete</a></td> </tr> <tr> <td>Lara</td>

Categories : Ajax

Reading contents from application map dynamically IN JSP page. - struts 2.0
Finally i got the solution. I tried many trail and error methods. And finally hit the answers. We can dynamically read the property values by doing: <s:iterator value="application.nameList" var="nameList"> <s:textfield theme="simple" value="%{application.animalDTO['name_' + #nameList]}" /> </s:iterator> I tried %{application.animalDTO['name_' + #nameList]} and it worked. :-)

Categories : Java

How to apply jQuery expander after changing div contents dynamically?
First you should wrap your expander code into a function: function initExpander() { $('div.expandable').expander({ slicePoint: 200, preserveWords: true, widow: 4, expandText: 'continue reading', detailClass: 'expanderDetails', afterExpand: function(){ $('#mybutton').click(); //simulate a different click. } }); } Then you can use this function every time you need to initialize the expander, for example after the DOM load: $(document).ready(function() { initExpander(); }); Or right after the ajax call: $.ajax({ url: '/doajax', // .... your ajax request here success: function () { initExpander(); } }); If you are using done() with ajax, it's fine too: $.ajax({ url: '/doajax',

Categories : Jquery

Adding pcap file contents to Hash Table dynamically in lua
Seems that you're trying to make the stat table a dict of statistics; if so, make sure to initialize its members correctly (by the client, whatever its value is). Maybe this helps? do stat = {} local file = io.open("luawrite","w") local function init_listener() local tap = Listener.new("wlan") local dest_addr = Field.new("wlan.da") local pkt_type = Field.new("wlan.fc.type") function tap.reset() local client = dest_addr() stat[client] = stat[client] or {numberofpkts = 0} stat[client].numberofpkts = 0 end function tap.packet(pinfo, tvb) local client, type = dest_addr(), pkt_type() if(tostring(type) == '2') then stat[client] = stat[client] or {numberofpkts =

Categories : Networking

How does one transfer the contents of dynamically allocated structures and substructures of doubles to an array? (C)
Yes, the code you have will copy the pointers, not the doubles. You need to copy the contents of each subarray, and their subarrays (model1, model2, model3 which you don't provide the definitions of. So something like (if model1 etc are just double[]) ... parameters current; double checkem[MAX_PARS]; double *p = &checkem[0]; // copy X into checkem memcpy(p, &current.x, numx * sizeof(struct model1)); p += (numx * sizeof(struct model1)) / sizeof(double); // copy Y into checkem after X memcpy(p, &current.y, numy * sizeof(struct model2)); p += (numy * sizeof(struct model2)) / sizeof(double); // copy Z into checkem after Y memcpy(p, &current.z, numz * sizeof(struct model3)); If model1, model2 and model3 are more complex than an array of doubles, you'll need to copy the do

Categories : C

Having trouble with changing an array position and displaying contents dynamically with angular
You can simply have allQuestions inside the scope. I dont think you need two separate modules just to track the current question. count alone should serve the purpose. var myApp = angular.module('myApp', []); function questionCtrl($scope){ $scope.allQuestions = [....]; $scope.count = 0; $scope.upCount = function(){ /* make sure index don't run out of range */ if($scope.allQuestions[$scope.count + 1]) $scope.count = $scope.count + 1; }; $scope.upCount = function(){ /* make sure index don't run out of range */ if($scope.allQuestions[$scope.count - 1]) $scope.count = $scope.count - 1; }; } And then in your HTML you could simply do: <body ng-app="myApp"> <div ng-controller="questionCtrl">

Categories : Javascript

Python how to retrieve list of changes by new additional contents, changes contents and deleted contents
I think you need to use difflib.Differ to do that: http://docs.python.org/2/library/difflib.html if you google "difflib.Differ Example" you'll find plenty of examples that will help you. edit: here's an example text1 = """Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer eu lacus accumsan arcu fermentum euismod. Donec pulvinar porttitor tellus. Aliquam venenatis. Donec facilisis pharetra tortor. In nec""" text1_lines = text1.splitlines() text2 = """Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer eu lacus accumsan arcu fermentum euismod. Donec pulvinar, porttitor tellus. Aliquam venenatis. Donec facilisis pharetra tortor. In nec""" text2_lines = text2.splitlines() import difflib d = difflib.Differ() diff = d.compare(text1_lines, text2_lines) print '

Categories : Python

How do you dynamically create a multi-form wizard in Django from the same form?
I don't know if there's a way to do this in the exact way you describe, but the Django docs has a tutorial describing how to implement this use case.

Categories : Python

Disable next form field on dynamically inserted form elements
$(".enablePPG").on("click", function() { if($(this).is(":checked") == true) $(this).parent().next().children().attr("disabled", "disabled"); else $(this).parent().next().children().removeAttr("disabled"); });

Categories : Javascript

Reading the contents of the dynamically created buffer giving wrong address of memory for second call to function
Streams are like normal files in that they're sequential in nature and once you've read data, the "read cursor" is advanced and another call to Read() will read more data, and so on. To seek backwards to re-read the same data again, use IStream::Seek(). For example, to go back to the start of the stream: LARGE_INTEGER li = { 0 }; HRESULT hr = pStream->Seek(li, STREAM_SEEK_SET, NULL); Not all streams support seeking so you should always check the return code for error.

Categories : C++

Change Qt application icons dynamically when language change event
You can easily load application icon dynamically by using setWindowIcon method. Assuming mainWin is your QMainWindow. if (lang == en) mainWin.setWindowIcon(QIcon(":/Resources/icon/en-icon.png")); else if (lang == vn) mainWin.setWindowIcon(QIcon(":/Resources/icon/vn-icon.png")); Hope this can help.

Categories : Qt

Submit Form Contents to a URL
You can do this all in javascript without a form. Just check the key code with each keyboard press - if it's the Enter key (13), then do your redirect. Here's a full working page: <!DOCTYPE html> <html> <head> <title></title> </head> <body> <input type="text" id="solution" onkeyup="doSomething(event);"> <input type="button" value="Click Me" onclick="redirect();"> <script type="text/javascript"> function doSomething(e) { var keyCode = e.keyCode || e.charCode; if (keyCode === 13) { redirect(); } } function redirect() { window.location.href = "http://www.MYURL.com/" + document.getElementById("solution").value + ".html"; } </script> </b

Categories : Javascript

add to list with contents from form
Change $(".title").html($("[name=title]").val()); $(".date").html($("[name=date]").val()); To $(".title").append($("[name=title]").val()); $(".date").append($("[name=date]").val());

Categories : Javascript

Use PHP to change contents of an element
You can make all the Javascript(including Jquery) and HTML work using PHP by simply echoing the data. For example: <?php echo "<script>$('#error').css('visibility','visible');</script> ?> Remember using Single quotes in the Javascript so as not to clash with double-quotes of echo function of PHP.

Categories : PHP

Change the contents of a div using Javascript
Actually, in javascript you can't open a string on a line and close it multiple lines after. You should replace $("#latestgames").html("<div> </div>") } with $("#latestgames").html("<div></div>") }

Categories : Javascript

ASP .NET MVC Let admin change contents of view
If you need just CMS functionality, then you are on the way to make it. It's true that admins might store some part of content, and post in unencoded, just to make browser be able to understand markup code. But if your intention is to customize views itself, with remaining rest of content to stay the same, it is some kind on theming. E.g. using different Views in different Themes. There are plenty of ways how to implement theming: XSLT, Templating etc.

Categories : Asp Net Mvc

Change div contents on link click
Put your code inside DOM ready: http://api.jquery.com/ready/ <script type="text/javascript"> $(document).ready(function() { $('#GFXWork').click(function(){ $('#portfolioWork').load('portfolioContent.html #motionGraphics'); }); }); </script> Since you use old version of JQuery, use this code for fancybox: $('.fancyYoutube').live('click',function(){ $.fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'width' : 680, 'height' : 395, 'href' : this.href.replace(new RegExp("watch\?v=", "i"), 'v/'), 'type' : 'swf', 'swf' : { 'wmode' : 'transparent', 'allowfullscreen' : true } }); return false; }); $("a[rel=churchPoster]").fancybox({ 'interval' : 2500, 'transitionIn' : 'elastic', 'transitionOut' : 'elast

Categories : Javascript

change contents of one script using another in javascript
You can do something like this: var code = "javascript:go('http://www.adworkmedia.com/go.php?camp=4556&pub=24043&id=10694&sid=', 'trials'); return false;" $('.Tips4').attr('onclick', code);

Categories : Javascript

Change colour of div by hovering over the contents?
If only they had enough sense to create, for us, the :parent pseudo class. In the meantime, you'll need to use JavaScript. Would something like this work for you? <script type="text/javascript"> $(document).ready(function(e){ $("div#divID a#anchorID").mouseenter(function(){ var divElement = $(this).parent(); // Style the div to its hover style (hovering over link) }).mouseleave(function(){ var divElement = $(this).parent(); // Style the div to its base style (not hovering over link) }); }); </script>

Categories : CSS

Centering a form, but maintaining alignment of its contents
text-align is not a property to 'align' divs or forms; instead, as it says, it aligns text. If you want to center a block-level element, you'll have to use margin. The default way to center a single element with margin is to set it , for example for a top-level container, to margin: 0px auto 0px;. If you want a lay-out with 3 columns, I'd rather think you'd want something like this. You can style the margins of your divs by setting margin-left or margin-right, then style the first/last element with advanced selectors (so you don't have a margin-left for your first element, or a margin-right for your last). As you can see, the forms are now centered, but their content is not. (You need to give your forms a width, else they will fill the containing block by default if they have content).

Categories : HTML

Get Contents of a File on PHP Form Mail() Function
There was actually a simple answer without involving database, classes so on. The template sometempalte.txt file is read using file_get_contents.... <?php //some form with validation //send form via email //In this somethingtemplate.txt has content as an email message //"Hello #name#. You registered with email: #email#." //using str_replace to replace these keywords $body = file_get_contents("sometemplate.txt"); $body = str_replace("#name#",$_POST['name'],$body); $body = str_replace("#email#",$_POST['email'],$body); mail($_POST['email'], 'Subject', $body, 'From: email@email.com'); ?>

Categories : PHP

How to drag and drop form element contents
You need to use helper method of jquery draggable. In that helper method get the dragable control .. From that controll get the value of the control and set it as hellper value. on dropping get that value from like it was available in like ui.helper $(dragableSelector).draggable({ scroll: false, appendTo: "body", cursor: "move", cursorAt: { top: 5, left: -20 }, helper: function (event) { //your intput conrol var ctrl = $(this); //get value from control var val = ctrl.attr('val'); //wrap it in div soo you can see on dragging. var div = $("<div style='z-index:9999;position:absolute;overflow:auto;' >"+val+ "</div>"); and in you droping section you need to do some thing like this. $(dropableElementS

Categories : Jquery

How to get POST contents before form submits using javascript
You can use an extension for intercept the data : Tamper Data on FireFox https://addons.mozilla.org/fr/firefox/addon/tamper-data/ You can intercept and modify all headers requests

Categories : Javascript

How to submit a specific form without making the contents of both go away?
This should work for you, <FORM name="personal"> Name:<Input type="text"><br> E-mail:<Input type="text"><br> <Input type="submit" name="form2" value="submit"> </FORM> <hr> <FORM name="preferences"> Favourite food:<Input type="text"><br> Favourite drink:<Input type="text"><br> <Input type="submit" name="form2" value="submit"> </FORM> </body>

Categories : Javascript

Change the contents of the element's onclick function
It depends on what you are trying to do, but here is a way of doing it which would not even require the changing of the function. var myValue = 0 document.getElementById("test").onclick = function (aEvent) { myValue++; alert(myValue); } See fiddle: http://jsfiddle.net/AqZHZ/

Categories : Javascript

Change the codeigniter view contents without reload
Yeah, that's a typical Ajax thing. But unfortunately that's a bit too big to just deliver you the answer (or I am too lazy, but you would benefit the most out of it, by figuring this out yourself). My suggestion is, that you learn jQuery and Ajax (if you don't know that already). For your problem, you specifically want to send the mails to your PHP-Function sendmail() via Ajax. This function either returns a Success- or an Errormessage (with json_encode() around it, that's how I'd do it). The Ajax-function then displays the message. This is neither tested nor should be the final solution... just a hint: The PHP Function: <?php function sendmail() { $mails = $_POST['mails']; $countEmails = count($mails); $success = 0; foreach ($mails as $mail) { // Check and send mails h

Categories : Ajax

Spring Roo JDialog Form update table contents
Since this is a very general request, I will try to give you a very general answer. You will need several things to make an Asynchronous call, and you will need to make several decisions. Understand that AJAX doesn't really mean AJAX anymore, but is a general term now applied to any process by which you make an asynchronous call from a browser-based client to some sort of back-end. First, you will need to write a method to handle your AJAX request. This is the first decision you must make: What are the request parameters to your service and what is the resulting payload. I am preferential to the RESTful JSON type requests, but a lot of people like XML. For a RESTful JSON version, you can do something like this: @RequestMapping("/widgets/{id}") public @ResponseBody Widget getMyWidget

Categories : Jquery

Use Greasemonkey to change row format based on one cell's contents?
This one's a little easier than the linked example, I think. The key is understanding jQuery selectors and then using jQuery's .css() function. Assuming the page doesn't use AJAX, here's a complete script that works on the HTML you provided: // ==UserScript== // @name _Format the "not checked" rows // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @grant GM_addStyle // ==/UserScript== /*- The @grant directive is needed to work around a design change introduced in GM 1.0. It restores the sandbox. */ //--- The 'Not Checked' is case-sensitive var notChkdRows = $( "tr.dataRow:has(th.booleanColumn img[title='Not Checked'])" ); //--- Use whatever CSS you wish notChkdRows.css ( { "background":

Categories : Javascript

jQuery - trigger event when cookie contents change
You can create a custom event: $(document).on('cookieUpdate', function(){ //update menu, whatever }); and trigger it once you changed your cookie: $(document).trigger('cookieUpdate');

Categories : Jquery

change the size of frame and it's contents accroding to screen
There's a good post about getting screen size here: http://stackoverflow.com/a/1016941/356708 Once you have that, you can manually set the size of your layout. This post shows some details about that: http://stackoverflow.com/a/11911123/356708 You can probably use pixels across-the-board, but not knowing what exactly you're doing, you might want to stick with something like DIP (example at same link)

Categories : Android

Change Activity contents based on options of a spinner?
Add the timePicker dynamically on spinners on onItemSelected method @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long id) { // TODO Auto-generated method stub int pos1=position; for(int i=0;i<mainlayout.getChildCount();i++) { View v=mainlayout.getChildAt(i) if(v instanceof TimePicker) mainlayout.removeView(v); } if(pos==0) { TimePicker t=new TimePicker (context); mainlayout.addView(t); } else { TimePicker t1=new TimePicker (context); mainlayout.addView(t1); TimePicker t2=new TimePicker (context); mainlayout.addView(t2); } }

Categories : Android

Change table cell contents based on content overflow
Either set the height of the cell and and set overflow:hidden;, which is kinda ugly, or split up the long comment and put the extra into a hidden span and use jquery to show hide it fiddle HTML <table> <tr> <td valign="top" width="100px" >comment 1:</td> <td class="smallComment">Blah blah blah blah blah blah blah blah blah blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha blah blah blah blha b

Categories : Javascript

How do you make the height of a Dojo DataGrid change based on it contents
The following will give the grid a max height of 300px but will shrink it if there are only a couple of rows displaying. Parent div var divGrid = domConstruct.toDom("<div id='divGrid' style='height:300px;'></div>"); domConstruct.place(divGrid, dojo.byId('Contents')); Create grid var grid = new DataGrid({ id: 'grid', store: store, structure: layout, style: "height:300px", loadingMessage: "Loading...", noDataMessage: "No data...", selectionMode: 'single', rowSelector: '20px' }); grid.placeAt(divGrid); grid.startup(); Now after the grid is loaded dojo.connect(grid, '_onFetchComplete', function() { var list = query('#grid .dojoxGridContent'); var height = list[0].offsetHeight + 25; // additional 25 to account for headers if (height < 300

Categories : Database



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.