Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
3,403,187 | 3,403,188 | Create a thumbnail from only part of an image | <p>I'm creating a thumbnail right now like this:</p>
<pre><code>// create thumbnail and save
var image = Image.FromFile(Server.MapPath(imageFilename));
var thumb = image.GetThumbnailImage(image.Width / 10, image.Height / 10, () => false, IntPtr.Zero);
thumb.Save(Server.MapPath(Path.ChangeExtension(imageFilename, "thumb" + Path.GetExtension(imageFilename))));
</code></pre>
<p>All it does is take the image, create a thumbnail 1/10th of the size, and save it.</p>
<p>I'd like to be able to create a thumbnail out of only part of the image. So say I have an image that is 200px by 200px. How can I take a 100px by 100px crop out of the middle of the image, and create a thumbnail out of it?</p>
| c# asp.net | [0, 9] |
5,307,179 | 5,307,180 | How to Set a Parameter for WhereParameters in EntityDataSource | <p>I have an EntityDataSource and I need set WHERE to a Local Variable Type: GUID.</p>
<p>My problem is I am not able to send my local variable Guid to EntityDataSource for a WHERE OPERATION.</p>
<p>I also tried to to use a ControlParameter<code><asp:ControlParameter Name="UserId" /></code> and have a Label with Text property on my Guid converted in String. But does not work.</p>
<p>Any idea how to solve teh matter</p>
<pre><code> <asp:EntityDataSource ID="EntityDataSourceListAuthors" runat="server"
AutoGenerateWhereClause="True"
ConnectionString="name=CmsConnectionStringEntityDataModel"
DefaultContainerName="CmsConnectionStringEntityDataModel"
EnableFlattening="False" EntitySetName="CmsAuthors" Where=""
EntityTypeFilter="" Select="">
<WhereParameters>
<asp:Parameter Name="UserId" />
</WhereParameters>
</asp:EntityDataSource>
</code></pre>
| c# asp.net | [0, 9] |
3,901,287 | 3,901,288 | Stop js slideshow caching amount of clicks | <p>Does anyone know how to stop this slideshow from 'caching' the amount of clicks through the slides? If I click the arrows 10 times then 10 slides will slide through is there a way to stop this? Or alternatively if you click the opposite arrow for it to cancel the 'cached' clicks from the other?</p>
<p><a href="http://www.switchonthecode.com/tutorials/jquery-creating-a-slideshow" rel="nofollow">http://www.switchonthecode.com/tutorials/jquery-creating-a-slideshow</a></p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
1,928,440 | 1,928,441 | jQuery Datepicker previous complete months | <p>I'm using the Datepicker in two input fields to allow users to select a start and end date, respectively. I was curious if there's a setting for jQuery UI's datepicker to initialize the start date field to a period that is two complete months prior to the end date, which defaults to the current date. So when a user opens the page, the end date will be the current date and the start date will display the two complete months prior to the current date, e.g. end date is initialized to 4-3-2012, the start date would be 2-1-12.</p>
<p>I was going to write some custom formula to handle this, but wanted to be sure there wasn't already a setting for this built into the Datepicker.</p>
| javascript jquery | [3, 5] |
4,371,596 | 4,371,597 | Problems defining a good hide/unhide jQuery function for dynamic divs | <p>A while ago I used this simple function to hide/unhide <code>divs</code>':</p>
<pre><code>$(document).ready(function() {
$('#job_desc').hide();
$('#slick-toggle').click(function() {
$('#job_desc').toggle(400);
return false;
});
});
</code></pre>
<p>As you can see I'm just hiding the <code>div</code> with the id <code>job_desc</code> when the document is ready, also creating a function that toggles the state of the <code>div</code> when the user clicks on the link with the id <code>slick-toggle</code>.</p>
<p>Well the times change, now I'm generating the <code>div</code>'s using a php loop like:</p>
<pre><code>while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<div id="job_desc['.$row["id_exp"].']">'.$job_desc.'</div>'
}
</code></pre>
<p>At this point I'm stuck, I know I need to generate not only the <code>div</code>'s dynamically but also the <em>toggle</em> buttons for every <code>div</code>.</p>
<p>I really don't know how to:</p>
<ol>
<li>Change my jquery function in order to work with dynamically generated <code>div</code>'s</li>
<li>How to hide all the <code>div</code>'s when document ready.</li>
</ol>
| php javascript jquery | [2, 3, 5] |
5,044,295 | 5,044,296 | Pass accepts header parameter to jquery ajax | <p>Whwn i inspect the below code in Chrome Console it shows me in Request header </p>
<blockquote>
<p>Accept:undefined</p>
</blockquote>
<pre><code>jQuery.ajax({
url: _this.attr('href'),
accepts: "application/json; charset=utf-8",
});
});
</code></pre>
<p>How do i set accept type as json . I dont want to set custom header or use beforeSend </p>
| javascript jquery | [3, 5] |
1,999,818 | 1,999,819 | How To Concatenate JavaScript Value to HTML Input 'name' Field? | <p>I have one variable <code>value</code> in my jQuery ready function, and I have one HTML input tag. I want this variable to be concatenated to input tag name field. Please help me.</p>
| javascript jquery | [3, 5] |
428,245 | 428,246 | Can i add rows and cells to a table dynamically? | <p>i want the user to submit a message, and that message will be added as a table row, automatically.. is it possible?</p>
<p>i want to do this: Table table=new Table. table.Rows.Add(row).. then i want to be able to insert a label into that row. e.g. row.Add(table)..but i cant find a way to do that!?!?</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.table.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.table.aspx</a></p>
<p>i want the table to grow one row bigger than it used to be with a label of the users newly added message.</p>
<p>i know that forums use tables .. but their table seems to be growing with every message submitted..</p>
<p>How can i achieve the same effect? with c#</p>
| c# asp.net | [0, 9] |
4,374,997 | 4,374,998 | jQuery.validate.js equalTo refuses to work | <p>I am trying to validate that my one password equals the other. The system keeps flagging the passwords not equal error.</p>
<p>Let me post my code:</p>
<pre><code><div class="fieldWrapper">
<label for="password" id="id_password">Password: </label>
<input id="id_password" type="password" placeholder="Password" name="password" maxlength="128" class="valid">
</div>
<div class="fieldWrapper">
<label for="password_verification">Confirm:</label>
<input id="id_password_verification" type="password" placeholder="Confirm" name="password_verification" maxlength="128">
</div>
$(document).ready(function()
{
$("#signup-form").validate({
rules: {
password: {
required: true,
minlength: 5
},
password_verification: {
required : true,
equalTo: "#id_password"
}
},
messages: {
password: {
required: "Please provide a password",
minlength: "Your password must be at least 5 characters long"
},
password_verification: {
required: "Please enter your password again",
equalTo: "Please enter the same password as above"
},
},
submitHandler: function(form) {
form.submit();
}
});
});
</code></pre>
<p>Does anyone have any clue where I am going wrong here? Note that my form has the id signup-form.</p>
| javascript jquery | [3, 5] |
5,750,220 | 5,750,221 | jquery syntax help processing ajax data | <p>I have two <code>form</code> tags. The second one pre-populates with options depending on the choice made in the first one, by making an Ajax request.</p>
<p>The data is returning perfectly and actually pre-populates the second <code>form</code> if I pass an example of some returned data to a local variable (see commented line). </p>
<p>Any advice would be appreciated as I am very new to JavaScript and am probably missing something blatantly obvious! I am using the following code:</p>
<pre><code>$(document).ready(function() {
$('#table').change(function() {
$.getJSON("/ajax_get", {
id : $(this).val(),
ajax : 'true'
}, function(data) {
/*
var data = [
{
"optionValue":"actor_id",
"optionDisplay": "actor_id"
},
{
"optionValue":"film_id",
"optionDisplay": "film_id"
},
{
"optionValue":"priority",
"optionDisplay": "priority"
}
];
*/
var $persons = $('#fields').empty();
$.each(data, function() {
$persons.append("<option value=" + this.optionValue + ">" + this.optionDisplay + "</option>");
});
});
});
});
</code></pre>
| php javascript jquery | [2, 3, 5] |
3,460,969 | 3,460,970 | jQuery product viewer | <p>Im trying to build a simple, lightweight product viewer using jquery.</p>
<p>I have a default image that I want to dissapear when a thumb is clicked and replace the image in 'X' div. </p>
<p>Ive attached a fiddle if anybody can explain how this is done?</p>
<p><a href="http://jsfiddle.net/BYuxR/3/" rel="nofollow">http://jsfiddle.net/BYuxR/3/</a></p>
| javascript jquery | [3, 5] |
5,826,921 | 5,826,922 | how to delete all sms of a specific contact number in android | <p>I have the following code which delete all the sms conversation ,</p>
<pre><code>Uri inboxUri = Uri.parse("content://sms/conversations");
int count = 0;
Cursor c = context.getContentResolver().query(inboxUri , null, null, null, null);
while (c.moveToNext()) {
try {
// Delete the SMS
String pid = c.getString(0); // Get id;
String uri = "content://sms/" + pid;
count = context.getContentResolver().delete(Uri.parse(uri),
null, null);
} catch (Exception e) {
}
}
return count;
</code></pre>
<p>but i want to delete sms of a specific contact number, What to do?</p>
| java android | [1, 4] |
3,695,188 | 3,695,189 | Copy table row and increment all name attributes | <p>Let's have a table like this:</p>
<pre><code><table>
<tr>
<td><input type="text" name="FirstName1" /></td>
<td><input type="text" name="LastName1" /></td>
</tr>
<tr>
<td><input type="text" name="FirstName2" /></td>
<td><input type="text" name="LastName2" /></td>
</tr>
</table>
</code></pre>
<p>I want to have a button that will add new row at the end of the table with incremented name attributes so it will look like this:</p>
<pre><code><table>
<tr>
<td><input type="text" name="FirstName1" /></td>
<td><input type="text" name="LastName1" /></td>
</tr>
<tr>
<td><input type="text" name="FirstName2" /></td>
<td><input type="text" name="LastName2" /></td>
</tr>
<tr>
<td><input type="text" name="FirstName3" /></td>
<td><input type="text" name="LastName3" /></td>
</tr>
</table>
</code></pre>
<p>And so on.</p>
<p>So far I have this but it does not increment name attributes:</p>
<pre><code>$("#newRowButton").click(function(){
$("table tr:last").clone().appendTo("table");
});
</code></pre>
| javascript jquery | [3, 5] |
5,269,431 | 5,269,432 | Read ID from URL and create a new one | <p>On Page_Load, I have to run code to check a url format. The url can be of the following formats:</p>
<pre><code>http://www.xyzabc.com/DisplayProduct?ID=230 or
http://www.xyzabc.com/DisplayProduct?ID=230&blahblah or
http://www.xyzabc.com/S(yya4h4rf4gjh5eo4uazix2t055)X(1))/DisplayProduct?ID=230
</code></pre>
<p>Whenever the url has an ID, I want to create a url in the following format:</p>
<pre><code>http://www.xyzabc.com/DisplayProduct?ID=<the id picked from the url>
</code></pre>
<p>Since the code will be run for every page (1500+) in the site, how can i write the best optimized code?</p>
| c# asp.net | [0, 9] |
1,784,725 | 1,784,726 | Append a word between empty element | <p>How can by jquery know that if between a element is empty append between same element word "there is not"?</p>
<pre><code><div>Ok</div>
<div>No</div>
<div></div> // i want append between this div "there is not" that is empty. Like: <div>there is not</div>
<div>Hello</div>
</code></pre>
| javascript jquery | [3, 5] |
1,988,922 | 1,988,923 | Animation does not get drawn in javascript? | <p>I know there is a .animate() function in jQuery, however i want to play around writing my own!</p>
<p>Ive got this script:</p>
<pre><code>var ball = $("#ball");
var p = $("#ball").position();
for(;;){
$("#ball").css("left", ++p.left);
if ( p.left == 400 ){
break;
}
}
</code></pre>
<p>with these elements:</p>
<pre><code>#board { height:500px; width:500px; background-color: gray; position:relative;}
#ball{ height: 50px; width:50px; background-color: red; position:absolute;}
<div id="board">
<div id="ball"></div>
</div>
</code></pre>
<p>Now what i wanna see when i open the browser, is the little red box run from left to right and stop at 400.</p>
<p>However when i load the page, the box is ALREADY at 400, so it skips the animation.</p>
<p>Essentially, i need the browser to draw each interation of the left co-ordinate.</p>
<p>How to i force the broswer to re-draw?</p>
| javascript jquery | [3, 5] |
5,366,595 | 5,366,596 | Can I use addClass on information stored in an HTML string? | <p>I have a string that for example looks like this.</p>
<pre><code>var html = '<div class="templatemo_post_text grid-85">
<div id="wmd-preview"><h2>Skriv något!</h2>
<p>Lorem ipsum</p></div>
<div class="templatemo_post_footer">
<div class="templatemo_post_on">
<span class="orange">Skrivet den</span> 3 Mar 2013</div>
<div class="templatemo_post_comment">
<a href="#">Inlägg nummer </a>
</div></div></div>';
</code></pre>
<p>Can I use the .addClass() in some way to add a class to the id=wmd-preview?<br>
Actually my question goes for all javascripting to modify existing variables. One other thing I would like to do is to replace the whole tag with a new one.</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
1,197,164 | 1,197,165 | jQuery - "Trigger a click" vs "Function call"? | <p>Say I have some actions binded to a link ( with .click or .live), and I want to do the same thing later, but I don't want duplicated code. Which is the correct way and why?</p>
<p>This:</p>
<pre><code>$('#link').click(function(){
//do stuff
});
//called later
$('#link').trigger('click');
</code></pre>
<p>OR:</p>
<pre><code>$('#link').click(function(){
do_stuff();
});
//called later
do_stuff();
//defined here
function do_stuff(){
//do stuff
}
</code></pre>
| javascript jquery | [3, 5] |
973,754 | 973,755 | How to add a script element in an iframe for jQuery | <p>I have a parent document and iframe with some JavaScript code to add a <code>script</code> element in an <code>iframe</code> bellow:</p>
<pre><code>var script = window.document.createElement('script');
script.src = '/jquery.myPlugin.js';
window.frames['test'].document.head.appendChild(script);
</code></pre>
<p>How to rewrite this code for jQuery?</p>
| javascript jquery | [3, 5] |
3,981,900 | 3,981,901 | Get index of currently focused input text field | <p>How do I get the index of the current input text field I'm currently in? I'm trying to jump to the next input field after pressing enter. This is what I've got:</p>
<pre><code> var index = $('input:text').index(this);
$('input:text')[nextIndex].focus();
</code></pre>
<p>But it's not going to the next one..</p>
| javascript jquery | [3, 5] |
1,841,375 | 1,841,376 | Adding z-index to a window | <p>How can I add a zindex value to the following string so that the pop-window is always on top?</p>
<pre><code>string winopen = "Window.Open('Details - " + name + "', 'test.aspx', 'dest=" + destination.Value + "&id=" + id.Value + "', [250,250], [100,100], true); return false;";
button1["onclick"] = winopen ;
</code></pre>
| c# javascript jquery | [0, 3, 5] |
4,897,645 | 4,897,646 | jquery if statement to check if there is a value of an input otherwise auto populate upon clicking link | <p>I have a simple <code>jQuery</code> statement like so:</p>
<pre><code>$(document).ready(function() {
$('#ltc_link').click(function() {
$('#USERDEFINE1').val( 'LT' );
$('#PHONENIGHT').val( '(111)111-1111' );
$('#INTERNET').val( 'NONE' );
$('#last_purchase').val( 'N/A' );
$('#last_purchase_date').val( 'N/A' );
});
});
</code></pre>
<p>It populates the input fields when the link <code>#ltc_link</code> is clicked.</p>
<p>If there is already text input into one or all of the fields than i don't want the click/link function to overwrite what the user entered. I know in javascript I can do something like so:</p>
<pre><code>if (!third.value) { third.value = '(111)111-1111'; }
if (!fourth.value) { fourth.value = 'NONE'; }
if (!fifth.value) { fifth.value = 'N/A'; }
if (!sixth.value) { sixth.value = 'N/A'; }
</code></pre>
<p>Need some help with the <code>jQuery</code> syntax. Thanks in advance.</p>
| javascript jquery | [3, 5] |
3,235,514 | 3,235,515 | How to refresh webpage after clicking on “Update” in Grid view | <p>I am working on an Asp.net, C# Application.
I want to Refresh the webpage after I clicking on “Update” LinkButton; in Grid view. I have tried the following code; however it just refreshes the page without saving the updated data in Grid view.</p>
<pre><code>protected void LinkButton1_Click1(object sender, EventArgs e)
{
Response.Redirect(Request.RawUrl.ToString());
}
</code></pre>
<p>Name of DataSource <code>SqlDataSourcePlan</code></p>
<pre><code>SELECT [PlanID], [Deposit], [DepositReturn], [Discount] FROM [PaymentPlan] WHERE ([Ref] = @Ref)
UPDATE [PaymentPlan] SET [Deposit] = @Deposit, [DepositReturn] = @DepositReturn, [Discount] = @Discount WHERE [PlanID] = @original_PlanID
</code></pre>
| c# asp.net | [0, 9] |
1,934,326 | 1,934,327 | Get text inside the label with jQuery | <p>From the following HTML, I want to get the text inside the <code><label></label></code> with jQuery but exclude the text inside the span in the label. </p>
<pre><code><label for="name">Name<span class="required">Required</span></label>
<input type="text" class="requiredField" name="name" />
</code></pre>
<p>I am trying following:</p>
<pre><code>jQuery('.requiredField').each(function() {
var labelText = jQuery(this).prev().text();
}
</code></pre>
<p>It receives the text which is inside the span <code>.required</code> as well (ie. NameRequired), but I want to get only "Name". How can I exclude that? Thanks.</p>
| javascript jquery | [3, 5] |
4,066,992 | 4,066,993 | Insert text into the input/textarea using Jquery | <pre><code><div class="ctrlHolder">
<label for="" id="name.label">Name</label>
<input name="name" id="name" type="text" class="textInput small" />
<p class="formHint">The name of the item you are submitting</p>
</div>
</code></pre>
<p>How can I insert predefined text into a input element. I'd like this function to active when the user doubleclicks the label element.</p>
<pre><code>$('#name.label').dblclick(function(){
$('#name').val('some text');
});
</code></pre>
| javascript jquery | [3, 5] |
2,905,821 | 2,905,822 | Jquery autogrow with another textarea | <p>I have an JS textarea autogrow and textarea more than 1. In example the textarea have an ID 1,2,3,4....</p>
<p>Here it's the JS</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$("#ctextarea").autoGrow();
});
</script>
</code></pre>
<p>Here it's the textarea :</p>
<pre><code><textarea name="comment" class="comment" maxlength="200" id="ctextarea<?php echo $msg_id;?>"></textarea>
</code></pre>
<p>And now how can I set that, if I go to textarea 2,3,4... the textarea will autogrow ?</p>
<p>Thanks for any help!</p>
| php javascript jquery | [2, 3, 5] |
2,038,179 | 2,038,180 | convert Jquery code to javascript | <p>Please can any body convert this small code to javascript?</p>
<pre><code>(function($) {
$(document).ready(function(){
$("p").click(function () {
$("p").filter(function(){
return ($(this).text().search(/(أ|ب|ت|ث|ج|ح|خ|د|ذ|ر|ز|س|ش|ص|ض|ط|ظ|ع|غ|ف|ق|ك|ل|م|ن|ه|و|ي)/) > -1);
}).addClass("rtl");
});
});
})(jQuery);
</code></pre>
<p>I attached this code with jQuery to Google Chrome Extension to fix direction to be RTL when detect Arabic language but it isn't worked when the website contain jQuery version</p>
<p>Please help</p>
| javascript jquery | [3, 5] |
1,383,954 | 1,383,955 | How can I use unescape() to include html custom char in a varable | <p>I have the word Cafe in my menu. I want it to be Café</p>
<p>I have been playing around with Js's escape and unescape and I can't make it do whats I thought it could do:</p>
<pre><code>$(document).ready(function(){
var newcafe = unescape('&eacute;');
text = $(".cafe-menu-item").text().replace('cafe', 'caf' + newcafe);
$(".cafe-menu-item").text(text);
});
</code></pre>
<p>Any idea how to make this work?</p>
| javascript jquery | [3, 5] |
1,676,241 | 1,676,242 | jQuery Color Animation - does not fade back to background color | <p>I'm trying to use a jQuery color animation plugin <a href="http://www.bitstorm.org/jquery/color-animation/" rel="nofollow">http://www.bitstorm.org/jquery/color-animation/</a>. When we call it and pass it, say <code>#FFFF00</code> (yellow), we see it change to yellow and fade away. But it never quite fades back to the element's original background color, which is white <code>#FFFFFF</code>. After doing a DOM inspection, I noticed that the elements ended up with a variety of styles added to it, such as:</p>
<ul>
<li><code>style="background-color: rgb(255, 255, 215);</code></li>
<li><code>style="background-color: rgb(255, 255, 149);</code></li>
<li><code>style="background-color: rgb(255, 255, 207);</code></li>
</ul>
<p>What do we need to do to get the plugin to work in such a way that at the end, the background color is the original color.</p>
| javascript jquery | [3, 5] |
4,626,016 | 4,626,017 | JQuery - Javascript | <p>The following is my code for one form of a two form aspx page. Would this code work? Or any help to make it work is much appreciated.</p>
<pre><code><form action="
$(document).ready(function(){
DoSearchSubmit('Search.aspx','Results.aspx')
});"
method="POST"
id="SearchForm" >
<input type="text" size="13" id="txtQuickSearch" name="txtQuickSearch" />
<input type="submit" class="searchButton" value="Search" id="btnSearchSubmit" />
</form>
</code></pre>
<p>Thanks</p>
| javascript jquery | [3, 5] |
3,929,962 | 3,929,963 | in jquery, how to make the right click of the mouse have the same behavior of left click | <p>what i want to realize is : when I right click a link , it also jump to another page like left click. how to do it? thanks very much.</p>
| javascript jquery | [3, 5] |
4,562,957 | 4,562,958 | sorting in XPath using Java | <p>I am using XML in my project for data to be Insert/Update/Delete & Searching.
currently i am using XPath for doing the above operations from my JAVA application.</p>
<p>How can i sort the data[ascending/descending] while reading from XML file using XPath.</p>
<p>Can anyone tell me the best way to full-fill this requirement. It's an urgent.</p>
| java javascript | [1, 3] |
3,331,499 | 3,331,500 | Simple <tr> Click Forcing Contained <a> Click | <p>How can I get a simple invoke click to function like this: <a href="http://jsfiddle.net/ftwPS/6/" rel="nofollow">http://jsfiddle.net/ftwPS/6/</a> I am apparently missing something basic since this is not working when you click "CLICK". </p>
<pre><code>$('tr').click(function() {
$(this).find('a').click();
});
<table>
<tr>
<td>
<a href="http://google.com" target="_blank">Google</a>
</td>
<td>
CLICK
</td>
</tr>
</table>
</code></pre>
<p>Any help would be greatly appreciated. Thank you.</p>
| javascript jquery | [3, 5] |
3,051,040 | 3,051,041 | Restructuring Json with Angularjs or Jquery | <p>What is the best way to restructure Json with Angularjs or Jquery..</p>
<p>I am getting a json with following format</p>
<pre><code> [
{
"address":"balh",
"lat":123,
"long":456
},
{
"address":"balh",
"lat":321,
"long":543
},
{
"address":"balh",
"lat":432,
"long":333
},
{
"address":"balh",
"lat":123,
"long":456
},
{
"address":"balh",
"lat":321,
"long":543
},
{
"address":"balh",
"lat":432,
"long":333
}
]
</code></pre>
<p>The format I need is to group it with three like following..</p>
<pre><code> {
"1":[
{
"address":"balh",
"lat":123,
"long":456
},
{
"address":"balh",
"lat":321,
"long":543
},
{
"address":"balh",
"lat":432,
"long":333
}
],
"2":[
{
"address":"balh",
"lat":123,
"long":456
},
{
"address":"balh",
"lat":321,
"long":543
},
{
"address":"balh",
"lat":432,
"long":333
}
]
}
</code></pre>
| javascript jquery | [3, 5] |
1,279,147 | 1,279,148 | Multiple ul reverse order | <p>I'm new to jquery and I have a page with multiple unordered lists ul.
I need to reverse order each ul, I saw this answer <a href="http://stackoverflow.com/questions/5347839/jquery-reversing-the-order-of-child-elements">jQuery reversing the order of child elements</a>
but it messes all items with all lists.
I tried to change the code to fit my needs but it doesn't do what I want, I can access each li of each ul but I don't know how to reverse the order of the li items.</p>
<p>My code:</p>
<pre><code>$(function() {
ul = $('ul'); // your parent element
ul.each(function(i,ul){
$(this).children().each(function (i,li) {
alert(i);/*i got to do something here*/
});
})
});
</code></pre>
| javascript jquery | [3, 5] |
4,785,423 | 4,785,424 | Using multiple object types in a dropdown to provide filtering for a data grid | <p>In my ASP.Net C# project I have a requirement to display a dropdown containing both people's names and office names.</p>
<p>When the user makes a selection, the event is handled in JavaScript and used to filter the results of a grid. So if the user selects a person's name from the dropdown then the grid displays only the results for that person. If the user selects an office then the grid should show the results for all the people in that office.</p>
<p>The filtering is handled in JavaScript on the OnClientDropDownClosed event of the dropdown.The grid and dropdown are Telerik controls not standard ones BTW. </p>
<p><strong>My question is - what is the best way to determine what type of item the user has selected.</strong>
The Value for the dropdown item is either the person's name or the office identifier.</p>
<p>I'm thinking I could simply add a prefix to the Value and do a substring test for it but that seems a little hacky...</p>
<p>is there a better way to achieve what I want?</p>
| c# javascript asp.net | [0, 3, 9] |
3,820,555 | 3,820,556 | Looking for Following JavaScript Library That Provide Navigation Menu Similar to FogBugz HomePage | <p>I was looking for JavaScript library, which is able to provide navigation menu similar to </p>
<p><a href="http://www.fogcreek.com/FogBugz/learnmore.html" rel="nofollow">http://www.fogcreek.com/FogBugz/learnmore.html</a> (left most navigation menu)</p>
<p>Any recommandation?</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
3,464,591 | 3,464,592 | iPhone email keyboard layout with asp .net TextBox | <p>You know how the iDevices will display a different keyboard layout depending on the HTML 5 value of the type attribute? So, <code><input type="email"...</code> will display the iPad's e-mail keboard layout. I am using a .net TextBox but would like to have the iDevices show the appropriate keyboard layout for the field. But the type attribute gets overridden to "text" when the TextBox control renders. Any ideas?</p>
| asp.net iphone | [9, 8] |
5,508,634 | 5,508,635 | Can't load all iframes | <p>I can't load all websites inside my iframe for example youtube, facebook and twitter.
I load all my pages from my database, other websites do load normal.</p>
<p>i tried:</p>
<p>js:</p>
<pre><code>function showeffect(sUrl,sName)
{
$('#effect').hide(1000);
$('#effect').show(2200);
$('#website').attr("src", sUrl);
}
</code></pre>
<p>php:</p>
<pre><code> <?php
$sql = "SELECT naam, url FROM items";
$database = new PDO('mysql:host=localhost;dbname=startandhome','root','');
$results = $database->query($sql);
$contentregel = 'contentregelblauw';
foreach($results as $row)
{
$itemnaam = $row['naam'];
$itemUrl = $row['url'];
echo "<div class=\"" .$contentregel ."\"><a href=\"#\" onclick=\"showeffect('".$itemUrl ."','".$itemnaam ."'); return false;\">" .$itemnaam ."</a></div>";
if ($contentregel == 'contentregelgrijs')
{
$contentregel = 'contentregelblauw';
}
else
{
$contentregel = 'contentregelgrijs';
}
}
?>
</code></pre>
<p>html:</p>
<pre><code><iframe id="website" class="website" src=""></iframe>
</code></pre>
| php jquery | [2, 5] |
179,665 | 179,666 | JQuery - Quick Sand JQuery (Default Selection) | <p>I'm using <a href="http://razorjack.net/quicksand/" rel="nofollow">http://razorjack.net/quicksand/</a> this jquery.
I want to select 'application' instead of 'everything' in page load.
Is there anyway to do?</p>
<p>Thanks,
Kevin</p>
| c# jquery | [0, 5] |
3,347,960 | 3,347,961 | How to add items in the DDL after data binding | <p>In my site when the user logs in he will be having option like Editmyaccount where he can edit the details.Here i am displaying the values entered by him in the registration page from DB and i am having two DDL's there i am displying appropriate country and state selected by user but i want to show some other countries and states along with it how can i do this?</p>
<pre><code> DropDownList1.DataSource = ProfileMasterDAL.bind();
DropDownList1.DataBind();
DropDownList1.Items.Insert(0, "--Select country--");
DropDownList1.SelectedIndex = 0;
</code></pre>
<p>Actually i am getting DDL from other page using session</p>
<pre><code> DropDownList1.Items.Add(new ListItem(Session["country"].ToString()));
DropDownList2.Items.Add(new ListItem(Session["state"].ToString()));
</code></pre>
| c# asp.net | [0, 9] |
3,404,787 | 3,404,788 | Can I develop an iPhone app using java? | <p>Is it possible to develop applications for the iPhone using Java? And if so, does it allow the use of custom jar files?</p>
<p>Thanks.</p>
| java iphone | [1, 8] |
936,262 | 936,263 | How to create the div, dynamically in asp.net | <p>I have some textbox and submit button.</p>
<p>When ever I click the submit button the div should be added dynamically in my aspx page.</p>
<p>Also the information which is available in the text box also displayed in the page default.</p>
<p>Use:Without using database i need to display the user suggestion in my page...</p>
| c# asp.net | [0, 9] |
748,698 | 748,699 | How to use jquery delegate method? | <p>Hi I have a problem... </p>
<p>I have to show all the results generated from a mysql query using php, in the end I generate a "block" that shortened is like this:</p>
<pre><code><div class="resultado">
<div class="titulo_articulo">
<h2>Título del artículo</h2>
</div>
<div class="detalles_articulo">
<div class="datos_articulo">
<div class="encabezado_autores">
<img src="images/gente.png"><span> AUTORES</span>
</div>
<div class="autores_instituciones">
<li>Daniel OC - UTPL</li>
<li>Francisco V - UTPL</li>
</div>
</div>
</div>
</div>
</code></pre>
<p>Sometimes searches return 5 results, so that code is inserted 5 times considering the different values (I'm not supposed to use antyhing that is not .hide() and .slide, so that's why I get a looot of code)...</p>
<p>I have a line generated for each result:
Mostrar resultado n1</p>
<p>That line is clicked and the following event is called:</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$(".resultado").hide();
$('.mostrar').click(function(e){
$(".resultado").slideToggle();
});
});
</script>
</code></pre>
<p>Ok, so what do I do to use only once that event? Otherwise I have to give 5 different ids and place the script 5 times...</p>
| php javascript jquery | [2, 3, 5] |
1,708,943 | 1,708,944 | How to pass values from parent.aspx page to user control? | <p>I have the following setup in my application and I'm having some difficulties passing values my user control.</p>
<p><strong>ASPX</strong></p>
<pre><code><%
var posts = this.getPosts();
foreach (var post in posts)
{ %>
<asp:TextBox runat="server" Text="<%: post.post_id %>" />
<% } %>
</code></pre>
<p><strong>CS</strong></p>
<pre><code>DataClassesDataContext db = new DataClassesDataContext();
public Post[] getPosts(int offset = 0, int lenght = 10)
{
var resultSet = db.Posts.OrderBy(x => x.date).Skip(offset).Take(lenght).ToArray();
return resultSet;
}
protected void Page_Load(object sender, EventArgs e)
{
DataBind();
}
</code></pre>
<p>The TextBox value on page load is "<% post.post_id %>". I even tried using the <%# post.post_id %> tag but that gives an error - "The name 'post' does not exist in the current context".</p>
<p>Any suggestions?</p>
| c# asp.net | [0, 9] |
219,059 | 219,060 | Put C# variable as parameter on ASP .NET custom control | <p>I have this code in my ASP page:</p>
<pre><code><%@ Register TagPrefix="genies" Namespace="TheNamespace" Assembly="TheAssembly"%>
...
<% string name = GetTag().Name; %>
<div class="<%= name %>"></div>
<genies:BarGenie ID="BarGenie1" runat="server" Title="<%= name %>" />
</code></pre>
<p>The BarGenie class has the following code:</p>
<pre><code>public class BarGenie : Control {
public string Title { get; set; }
protected override void Render(HtmlTextWriter writer) {
writer.Write("<div>" + Title + "</div>");
}
}
</code></pre>
<p>This is the HTML that is generated:</p>
<pre><code><div class="E00383"></div>
<div><%= name %></div>
</code></pre>
<p>I'd like to see this HTML:</p>
<pre><code><div class="E00383"></div>
<div>E00383</div>
</code></pre>
<p>I've tried various things in the ASPX code: @name, <%# name %> etc but I can't figure out what's going on. Is there some other way of inserting a custom control that I should be using? Do I have the wrong approach to using this custom control?</p>
| c# asp.net | [0, 9] |
2,686,069 | 2,686,070 | safe place to save code | <p>Where is the most secure place to store sensitive code on a server (ex, authorization php, contact scripts, sensitive or protected javascript)?</p>
<p>You guys/girls got any tips or tricks on how to protect that kind of stuff?</p>
| php javascript | [2, 3] |
3,640,260 | 3,640,261 | How can I create different number of button controls? | <p>I'm printing to the screen lots of entries from my database. I'd like each entry to have it's own button, so I can add that specific entry to my cart (saved in <code>Session[]</code>).</p>
<p>How can I do it?
I'd like to have something like this: <img src="http://i39.tinypic.com/xgf5z8.png" alt="alt text"></p>
<p>Thank you very much!! :)</p>
| c# asp.net | [0, 9] |
15,616 | 15,617 | ternary operator in ascx page | <p>I have this check in ListView</p>
<pre><code><%# Eval("Count") != null ? Eval("Count") : 0%>/<%# Eval("MaxRange")%>
</code></pre>
<p>now i want to change that if count is null then it should show nothing.</p>
<p>I tried this but no avail.</p>
<pre><code><%# Eval("Count") != null ? Eval("Count") + '/' + <%# Eval("MaxRange")%> : null %>
</code></pre>
<p>Please let me know how to do this.</p>
<p>Thanks.</p>
| c# asp.net | [0, 9] |
800,613 | 800,614 | How do I get url that is hidden by javascript on external website? | <p>How do I get url that is hidden by javascript on external website?</p>
<p>ex: <a href="http://royaldesign.se/Att_Dricka.aspx" rel="nofollow">http://royaldesign.se/Att_Dricka.aspx</a>
This url is constant through navigation of pages, so page content is loaded by javascript.</p>
<p>link location of a page: </p>
<pre><code>javascript:__doPostBack('ctl00$masterContent$DataPager2$ctl00$ctl00','')
javascript:__doPostBack('ctl00$masterContent$DataPager1$ctl00$ctl01','')
javascript:__doPostBack('ctl00$masterContent$DataPager1$ctl00$ctl02','')
</code></pre>
<p>.....</p>
<p>Is there a way to analyze (manually or by PHP script) the function __doPostBack to find out about the urls?</p>
<p>Thx in advance</p>
| javascript asp.net | [3, 9] |
3,022,146 | 3,022,147 | How to get unreaded sms/missed calls from my Android device? | <p>I have been developing Android application and I need to get unreaded sms/missed calls from my Android device. Are there any ways that I can do it? I hope there are some content provider that can do it. Thank you. </p>
| java android | [1, 4] |
5,943,962 | 5,943,963 | How to get specific item in Item template of Asp Grid view by using Jquery? | <p>How can I get effect on specific row of grid veiw</p>
<pre><code><asp:GridView ID="gvSearch" runat="server" DataKeyNames="guidId" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<div class="test1"> "test paragraph"
<img src="../Images/double-arrow.png"
style="margin-left: 741px;margin- top:39px;"
class="PreviewImage"
onclick="DisplayImg('<%# Eval("guidId") %>')"/>
</div>
</asp:TemplateField>
</Columns>
</asp:GridView>
</code></pre>
<p>Now by using Jquery, how can I show only one image on event of onmouseover on div, I tried below but it display images of all the rows.</p>
<pre><code> $('div.test1').mouseover(function () {
$('.PreviewImage').show();
})
</code></pre>
| c# jquery | [0, 5] |
2,028,579 | 2,028,580 | show() Not Working With Class | <p>This is an easy bit of coding, but something's there that i am doing wrong.I just can't figure it out.</p>
<pre><code>#div {
display:none;
}
</code></pre>
<p>JS:</p>
<pre><code>function show() {
var class = 1;
$("#div." + class).show("slow");
}
</code></pre>
<p>HTML:</p>
<pre><code><div id="div" class="1">John</div>
<div id="div" class="2">Tanner</div>
<input type="button" onclick="show()" />
</code></pre>
<p>Here I am trying to 'show()' a <code>div</code> of specific class.<br>
The problem is, this code works fine for <code>class="1"</code>. But when I change <code>var class</code> to <code>2</code>, it stops working.</p>
| javascript jquery | [3, 5] |
3,597,397 | 3,597,398 | jquery .empty() conflict with keypress event | <p>This is meant to allow a user to type in a message and then press enter to send it. This should clear the box so that the user can type in a new message. The problem is that the standard result of pressing enter (creation of a newline) is occurring <em>after</em> the .empty() event....so the text vanishes and is replaced by a newline, which is quite undesirable. How can I circumvent this?</p>
<pre><code> $('#messagebox').keypress(function(event) {
if (event.keyCode == '13') {
send();
$('#messagebox').empty();
}
});
</code></pre>
| javascript jquery | [3, 5] |
605,802 | 605,803 | programmatically refreshing a datagrid in asp.net | <p>I have an asp.net webpage that does a bunch of (slow, hence the problem) calculations and dumps them all into a datagrid in a webpage. I would like to be able to have the page show partial results. </p>
<p>I have figured out how to re-update the grid every time a row is done, but the page still doesn't display the results until all the calculations are complete. Does anyone know a call from asp.net that can tell the page to refresh itself? </p>
<p>p.s. the update function I am currently using is as follows:</p>
<pre><code> private void updateDisplay(DataTable outputTable)
{
if (outputTable.Rows.Count > 0)
{
PlaceHolder1.Controls.Clear();
PlaceHolder1.Controls.Add(new LiteralControl("<br>"));
GridView myView = new GridView();
myView.DataSource = outputTable;
myView.DataBind();
myView.Visible = true;
PlaceHolder1.Controls.Add(myView);
}
}
</code></pre>
| c# asp.net | [0, 9] |
5,597,957 | 5,597,958 | Jquery selector help | <p>I have the following:</p>
<pre><code><form id="my_form">
<input type="checkbox" name="a" value="a"> Check <img src="..." />
</form>
</code></pre>
<p>To handle the check and uncheck events I do (and this works):</p>
<pre><code>$('#my_form :checkbox).click(function() {
if($(this).is(':checked')) {
//...
}
//...
});
</code></pre>
<p>My question is: inside of that click function, how can I select the <code><img></code> tag that is right beside the checkbox? Can I do this without specifying an ID for the image? ..by "select" I mean that I need to be able to hide() and show() it. Thanks</p>
| javascript jquery | [3, 5] |
290,612 | 290,613 | javascript : sending custom parameters with window.open() but its not working | <pre><code><html>
<head>
<script>
function open_win()
{
window.open("http://localhost:8080/login","mywindow")
}
</script>
</head>
<body>
<input type="button" value="Open Window" onclick="open_win()">
</body>
</html>
</code></pre>
<p>Hi , </p>
<p>On click of a button , i am opening a <code>new website</code> (My web site )
I have two <code>text fields</code> ( One Text Field and another Password Field) , i am trying to send this values to the other opened window . </p>
<p>But its not working as I want.</p>
<p>I have tried the following ways </p>
<pre><code>1. window.open("http://localhost:8080/login?cid='username'&pwd='password'","mywindow")
2. window.open("http://localhost:8080/login","mywindow")
mywindow.getElementById('cid').value='MyUsername'
mywindow.getElementById('pwd').value='mypassword'
</code></pre>
<p>Could anybody please help me if this is possible or not ??</p>
<p>Sorry for the incomplete details , its a Post request . </p>
| javascript jquery | [3, 5] |
2,841,931 | 2,841,932 | how to start click or change function from inside js | <p>The problem is, <code>$('#menu').val(menu).trigger('change');</code> and <code>$('.parentcheck').val(0).attr('checked', true).trigger('click');</code> changes their state but doesn't fire their functions <code>$("#menu").change(function () {</code> and <code>$(".parentcheck").click(function () {</code>. How to deal with that problem?</p>
<p>My js code looks like that</p>
<pre><code>$(document).ready(function () {
$("#parent").hide();
$(".parentcheck").click(function () {
if ($(this).val() === "0") {
$("#parent").hide().find('option:selected').removeAttr('selected');
}
if ($(this).val() === "1") {
if ($("#parent option").length > 0) {
$("#parent").show();
}
}
$("#menu").change();
});
$("#menu").change(function () {
var selectedmenu = $("#menu").val();
var parentcheck = $(".parentcheck:checked").val();
if (selectedmenu != '' && selectedmenu != '0') {
$.ajax({
type: "POST",
url: "processor/optionsgenerator.php",
data: {
menu: selectedmenu
},
success: function (result, status, xResponse) {
if (result != '') {
if (parentcheck == '0' || !$(".parentcheck").is(":checked")) {
$("#parent").hide();
} else {
$("#parent").html(result);
$("#parent").show();
}
} else {
alert('Baza ilə əlaqədə problem var.');
$("#parent").hide();
}
},
error: function (e) {
alert(e);
}
});
} else $("#parent").hide();
});
$('#menu').val(menu).trigger('change');
if(parent==0) {
$('.parentcheck').val(0).attr('checked',true).trigger('click');
}
else {
$('.parentcheck').val(1).attr('checked',true).trigger('click');
$('#parent').val(parent);
}
});
</code></pre>
| javascript jquery | [3, 5] |
1,084,146 | 1,084,147 | Bind a jquery function to elements | <p>I am very new to jquery and need some help. I am trying to change a css element when I enter a textbox. I have applied a css class to my textboxes and I have a couple of div tags around my textboxes.</p>
<p>When a user selects the textbox I want to change the desired div tag.</p>
<p>This is how the html looks</p>
<pre><code><div class="left">
<div class="right">
<input name="myTextBoxID" type="text" id="myTextBoxID" class="myTextBox" />
<span id="rfInput"></span>
</div>
</div>
</code></pre>
<p>my jquery looks like this</p>
<pre><code><script language="javascript" type="text/javascript">
$(function () {
$('.myTextBox').focus(function () {
$('.box.left').addClass("active");
}).blur(function () {
$('.box.left').removeClass("active");
});
});
</script>
</code></pre>
<p>Now the jquery is working and changes the class on focus and blur however it effects all elements witht he class="myTextBox" how can I get jquery to attach to all elements however only fire the css change to the selected textboxes outside elements class?</p>
<p>Any help would be great!</p>
| javascript jquery | [3, 5] |
161,648 | 161,649 | How to extract string values from a URL? | <p>I want to extract following values from the url mentioned below? </p>
<ul>
<li>layout2</li>
<li>aqua</li>
</ul>
<p><strong>code:</strong></p>
<pre><code>var url = "http://localhost:8080/dflyers/edit.html?layout2&aqua"
var dataLayout = // I need url string (layout2) here
var dataTheme = // I need url string (aqua) here
</code></pre>
<p>Can some one help to get mentioned values using jQuery/Javascript? Thanks</p>
| javascript jquery | [3, 5] |
5,336,225 | 5,336,226 | how to add script inside a php code? | <p>How can I add script inside a php code? suppose i want to give an alert for a button click.. how can i do that??</p>
| php javascript | [2, 3] |
5,183,195 | 5,183,196 | Refresh div if PHP page returns true? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/9571447/jquery-refresh-if-php-file-echos-true">jQuery refresh if PHP file echo's 'true'</a> </p>
</blockquote>
<p>I have the following div on my index:</p>
<pre><code><div id='tv'> <? include 'tv.php' ?> </div>
</code></pre>
<p>I have a script that changes content in tv.php and returns 'true' at a certain time called checktime.php.</p>
<p>I'm trying to have jQuery in the index header to check the PHP page every 10 seconds and if checktime.php returns 'true' jQuery 'refreshes' the content of the #tv div. This is the code I currently have but it's not working. It seems to check checktime.php but the div doesn't automatically refresh.</p>
<pre><code><script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function(){
setInterval("checkTime()", 10000);
function checkTime(){
$.ajax({
url: 'checktime.php',
success: function(refresh){
if($.trim(refresh) == "true"){
$('#tv').load('tv.php');
}
}
});
}
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
5,810,361 | 5,810,362 | How to stop unloading the page? | <p>I have a page where user needs to enter some data and click save to validate the changes, but my problem is if the user is trying to close the browser window or click on a different link to navigate to a different page..I need to delete all the entries the user has saved so far..
I am doing it the following way</p>
<pre><code>window.onbeforeunload = function()
{
if(confirm('Are you sure you want to navigate'))
{
//Invoke `enter code here`server side method
}
else
{
// return false;
}
}
</code></pre>
<p>Everything works fine if he click on Yes, the problem comes when he click on "No"..Even if he click on No..the page unload method is getting called and it is redirected to a different page..but I want it to stay in the same page in same state...can you please help me in achieving this.</p>
<p>Thanks and appreciate your response....</p>
| javascript jquery | [3, 5] |
101,539 | 101,540 | How do I pass a method through another method without it being called, and pass a variable object into it? | <p>Sorry for my last question. This is the question with better formatting.</p>
<p>I have a method that I am passing a method through :</p>
<pre><code>method("my_passed_method()")
function method(passed_method){
eval(passed_method.replace('()', + '(' + obj + ')' );
}
</code></pre>
<p>But this returns :</p>
<p><code>SyntaxError: missing ] after element list</code></p>
<p>I'm assuming this is just some simple JSON syntactical error.</p>
| javascript jquery | [3, 5] |
5,439,356 | 5,439,357 | Take User Input Value and Redirect | <p>Basically, I have a search box. Once clicked, the value within the search box would be sanitize and then redirects as a Get Var rather than a Post.</p>
<p>I have one method of taking the User's Input value and redirecting to what they want to search (But it turns into a Post Method).</p>
<p>I want to achieve the following:</p>
<ol>
<li>User Input Value: "I am Searching"</li>
<li>User/Web Client (Javascript) takes User Input Value, sanitize it for URL, and redirects.</li>
<li>User is taken to: example.com/search/i-am-searching</li>
</ol>
<p>Rather than:</p>
<ol>
<li>User Input Value: "I am Searching"</li>
<li>Server Side takes Post Value of "I am Searching" then redirects.</li>
<li>User is taken to: example.com/search/i-am-searching</li>
</ol>
| php javascript | [2, 3] |
3,647,722 | 3,647,723 | Remove everything after last backslash jquery | <p><code>var t = "\kolobok\molobok\nolobok"</code></p>
<p>I need "\kolobok\molobok" from it.</p>
<p>Thank you.</p>
| javascript jquery | [3, 5] |
4,505,426 | 4,505,427 | Override onclick event in javascript/jquery | <p>I have a table(3 td's) with onclick event and need different onclick event for one td.</p>
<pre><code> <table onclick="window.location.href='http://www.google.com?id=12345'">
<tr>
<td>text</div>
<td>text1</div>
<td onclick="favTheater('test')">text3</td>
</tr>
</table>
<script type="text/javascript">
function favTheater(msg){
var e = window.event;
e.stopPropagation();
e.preventDefault();
window.location.href="http://www.yahoo.co.in?msg=msg";
}
</script>
</code></pre>
<p>I need to override table <code>onclick</code> and need to function <code>favTheater('test')</code>
Note: table in loop and each id and msg will change.
Please help me on this.</p>
| javascript jquery | [3, 5] |
60,858 | 60,859 | Problem in populating gridview from stored procedure | <p>I have a Gridview which I'm populating from a Stored Procedure which accepts 3 parameters. First parameter gets its value from a form variable Request.Form["uid"], second and third get its value from DropDownLists SelectedValue property. Second and third parameter should accept NULL if nothing is selected from DropDownLists. I have also set the ConvertEmptyStringToNull property of the parameters to true.
The Gridview is still not populating. But when I pass parameters manually and execute the stored procedure from SQL Server Management Studio as well as Visual Studio's test query window, it works fine.</p>
<p>My SQLDataSource for the Gridview looks like this:</p>
<pre><code><asp:SqlDataSource ID="SqlGVDownloadHistory" CancelSelectOnNullParameter="false" runat="server" ConnectionString="<%$ ConnectionStrings:xxx %>"
SelectCommand="spDHR" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:FormParameter FormField="uid" Name="UIDUser" Type="String" />
<asp:ControlParameter ControlID="ddlSelectDocument" Name="FileName"
PropertyName="SelectedValue" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter ControlID="ddlSelectCCO" Name="UIDSelect" PropertyName="SelectedValue"
Type="String" ConvertEmptyStringToNull="true" />
</SelectParameters>
</asp:SqlDataSource>
</code></pre>
<p>Please help!!</p>
| c# asp.net | [0, 9] |
852,913 | 852,914 | Call a jQuery Function with onClick event of Image Button | <p>I have a form in which a table of dynamic data is built with PHP. Within each row is an image that when clicked calls a jQuery function with a click event.</p>
<p>For example, if the image has an id of eventnfo_0, i have a function like this:</p>
<pre><code>$("#eventnfo_0").click(function()
</code></pre>
<p>It all works fine as long as I have a defined click event for each row. The problem is, I need to make it dynamic because the number of rows can vary so it's not feasible to build a separate function as depicted above for each row.</p>
<p>My thought is there must be a way to call a jQuery function from an onclick event and pass a row number, but thus far, no dice.</p>
<p>I'm sure it's not an uncommon task, but I've not had any luck with my searches.</p>
<p>Any thoughts are appreciated.</p>
| php jquery | [2, 5] |
4,670,354 | 4,670,355 | Forcing SSL (https) on a page by page basis | <p>How can I set up my page load event in my code behind to redirect to an url that has an https prefix? I would need it to work with urls that have query strings attached too.</p>
<p>It's one thing to construct a link that goes straight to the https page, but I don't want the user to be able to manually change it to an http page.</p>
<p>Also I don't want to do it with javascript because it might be turned off.</p>
<p>I'm guessing a regular expression?</p>
| c# asp.net | [0, 9] |
5,499,883 | 5,499,884 | Android - Setting usage flag | <p>I am currently creating an app and would like to create a demo version (free) and a full version.</p>
<p>However, I am wondering how I can set some sort of flag so that when the demo version has been used 5 times, you have to buy the full version to continue using. This usage will be detected on a submit button.</p>
<p>I was considering setting a flag in the app, however releasied that the user could uninstall the app and then re-install it overcoming my set flag (as this would set it back to 0).</p>
<p>Has anyone got any clever solutions for my little dilema?</p>
<p>Thanks</p>
| java android | [1, 4] |
5,237,352 | 5,237,353 | Dropdown list where options populate a second list js/php? | <p>I have a 2 dropdown lists side by side. When user selects from the first list, i need the second list's options to be displayed.</p>
<p>The sub-options will be retrieved from a database. I have a page that will return the necessary html given the specific parent. I just need the first list's selection to trigger an update of list #2.</p>
<p>Whats the best way of accomplishing this?</p>
<pre><code><select id="parent" name="list1">
<option value="1">Parent 1</option>
<option value="2">Parent 2</option>
<option value="3">Parent 3</option>
<option value="4">Parent 4</option>
</select>
<select id="child" name="list2">
</select>
</code></pre>
<p>caveat: cant use a form, cause the selection's are part of another form.</p>
| php javascript | [2, 3] |
1,615,018 | 1,615,019 | an array of strings as a jQuery selector? | <p>I have an array of strings that are valid jQuery selectors (i.e. IDs of elements on the page): </p>
<pre><code>["#p1", "#p2", "#p3", "#p4", "#p5"]
</code></pre>
<p>I want to select elements with those IDs into a jQuery array. This is probably elementary, but I can't find anything online. I could have a for-loop which creates a string <code>"#p1,#p2,#p3,#p4,#p5"</code> which could then be passed to jQuery as a single selector, but isn't there another way? Isn't there a way to pass an array of strings as a selector?</p>
<p><strong>EDIT:</strong> Actually, there is <a href="http://stackoverflow.com/questions/201724/easy-way-to-turn-javascript-array-into-comma-separated-list/201733">an answer out there already</a>.</p>
| javascript jquery | [3, 5] |
135,165 | 135,166 | Dissect my jQuery - can't use keyup function to insert number of characters into another textarea | <p>I'm trying to figure out why my jQuery isn't working. I've got jQuery linked to, and then after that, I try to bind to the textarea content. I've used name=content and name=#content both.</p>
<pre><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$('input[name=content]').bind('keyup',function(){
$('#desctag').val($(this).length)
});
</script>
</code></pre>
<p>Why isn't it working?</p>
<p>Code is now:</p>
<pre><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('input[name=#content]').bind('keyup',function(){
$('#desctag').val($(this).length)
})})
</script>
</code></pre>
| javascript jquery | [3, 5] |
2,491,652 | 2,491,653 | Finding out what's slowing down ASP.NET pages | <p>I have a rather 'heavy' ASP.NET page, and currently the speed is fairly unacceptable - there is a <em>lot</em> of database communication, and displaying large grids. But I effectively want to find out what's actually causing the most slowdown, and working from there.</p>
<p>Are there any tools built into Visual Studio 2008, or any third party tools, that'll allow me to do this?</p>
| c# asp.net | [0, 9] |
2,005,702 | 2,005,703 | String was not recognized as a valid DateTime.Couldn't store <22/06/2012 12:00:00 AM> in Purchase Date Column.Expected type is DateTime | <p>I am receiving this exception on XP running machine but on windows 7, there is no issue. I am trying to format date time as follows, </p>
<pre><code>dr.BeginEdit();
dr["Pdate"] = ((DateTime)dr[dc]).ToString("dd/MM/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
dr.EndEdit();
dr.AcceptChanges();
</code></pre>
<p>It is working fine for '2012-03-04 00:00:00.000' but issue is for '2011-06-22 00:00:00.000'
Any idea?</p>
| c# asp.net | [0, 9] |
896,874 | 896,875 | how to bind key combination ctrl+x+return in jquery | <p>Is there any way to catch key combination 'ctrl+x+return' in jquery(or javascript), such that if user presses this key combination, a function is called. I tried using the jquery hotkeys plugin, but that didn't worked.</p>
| javascript jquery | [3, 5] |
6,023,658 | 6,023,659 | How to make Dropdown List with checkboxes? | <p>How do we make a drop down list with checkboxes? C# lang is preferred for this.</p>
| c# asp.net | [0, 9] |
2,819,444 | 2,819,445 | Cycle through int values | <p>I need some input.</p>
<p>Say you have an int-based Enum with values 1 through 10. If you then have a variable that is, say, value corresponding to 7, how can you easiest set it to next value in the given range without going out of bounds? If the value reaches the limit, it should reset itself to first in the range.</p>
<p>I want a one-liner solution to this. I don't want to do ++ and then check and reset value, plus it has to work in both C# and JavaScript. I suppose something in the Math object might be of help, I don't know...</p>
<p>thanks</p>
| c# javascript | [0, 3] |
1,137,698 | 1,137,699 | How to remove selection from a listbox in html by javascript and jQuery? | <p>After I click an item on a listbox, I'll do this processing then I need to remove this selection as it was at the first time so that I can click the same item again and fire the event of selected index change.</p>
| javascript jquery | [3, 5] |
482,933 | 482,934 | How to implement smart bar in Android app? | <p>How to Create Slide Drawer in android app same as in facebook app.</p>
| java android | [1, 4] |
1,687,663 | 1,687,664 | How to get the primitive value of a checkbox? | <p>Edit: Okay, I had to redo the example because the problem didn't occur in my first example</p>
<pre><code>function CheckboxClick(checkbox, check) {
this.checked = check;
checkbox.click(function (event) {
alert(this.checked);
});
}
CheckboxClick($("#checkbox"), $("#checkbox").attr("checked"));
</code></pre>
<p>Every time you click on that checkbox, this.checked's value changes. What do I need to do to get it to stop changing? It's obviously assigning by reference but I don't know how to get the primitive value. I tried valueOf() but that didn't work for me. </p>
| javascript jquery | [3, 5] |
3,682,603 | 3,682,604 | Why is my Javascript not valid? | <p>Can anyone please help?<br>
I have a div with ID 'adpictureholder', to which I dynamically add (or remove) images.<br>
On Form submit I want to get SRC values of all these images within that DIV and put them to the value of one hidden input with ID 'piclinkslisttosubmit'. <br> The thing is that my current Javascript does not function, as if there is some syntax typo there, but I don't see where. <br>Can anyone please have a quick look at it?</p>
<pre><code>function copyonsubmit(){
var strump1 = '';
var i=0;
var endi = document.getElementById('adpictureholder').childNodes[].length - 1;
var images = document.getElementById('adpictureholder').childNodes[];
for (i=0;i<=endi;i++)
{
strump1 = strump1 + '|' + images[i].src;
}
document.getElementById('piclinkslisttosubmit').value = strump1;
}
</code></pre>
| javascript jquery | [3, 5] |
5,449,245 | 5,449,246 | is it legal to store jquery reference? | <pre><code>var global_ref = null;
function a(){
function some_click_handler {
global_ref = $(this);
}
}
// later in
function b()
{
$(global_ref).css(...) // or global_ref.css(...) ???
}
</code></pre>
<p>Is above concept right? and the syntax right?</p>
| javascript jquery | [3, 5] |
2,887,033 | 2,887,034 | how to format time including miliseconds | <p>I'm trying to get a time string in the format of YYYYMMDD-HHMMSSMiliseconds in android</p>
<p>Ex: 20130312-1723437520 (2013 March 12th, 17 Hour 23 Minutes 43 Seconds 7520 Miliseconds)</p>
<pre><code>Time now = new Time();
now.setToNow();
String snapshotTime = now.format("yyyyMMdd-HHmmss");
</code></pre>
<p>First of all, above code doesn't even work properly. <code>snapshotTime</code> is always set to the format string itself.</p>
<p>Second of all, according to the <a href="http://developer.android.com/reference/android/text/format/Time.html" rel="nofollow">android documentation</a>, there's no way to record miliseconds. </p>
<p>How can I accomplish this?</p>
| java android | [1, 4] |
413,179 | 413,180 | Do any of these javascript minifiers remove debug statements? | <p>It would be nice if I could put debug/console log statements in my javascript, then have a js minifier/compacter remove these when it compiles.</p>
<p>Does this exist?</p>
| javascript jquery | [3, 5] |
1,382,993 | 1,382,994 | Javascript or Jquery Calendar which should hide previous dates from current date and also Week ends | <p>Need a calendar script in Javascript or Jquery which should have the option like disabling all the previous dates from the current date and also disable the Saturday's and Sunday's too</p>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
5,066,692 | 5,066,693 | Creating a loop that populates a select tag | <pre><code>function buildOrder(data) {
var $fragment;
$fragment = $('<div/>');
for (var i = 0; i < data.length; i++) {
$fragment.append('<div class="row-container"><div class="row cupcake-row">' + data[i].name + '</div><div class="clear"></div></div>');
}
$('#review-section').append($fragment);
}
</code></pre>
<p>I essentially want to add a tag with 50 options being dynamically created using a for loop. But I'm not sure what the syntax would be to add it to the <code><div class="row-container"/></code> I know in php I would just throw the loop in the middle and echo the options, however that doesnt work in javascript.</p>
<p>EDIT:</p>
<p>It would look like this:</p>
<pre><code>$fragment.append('<div class="row-container"><div class="row cupcake-row">' + data[i].name + '</div><select><option value="1">1</option> etc...</select><div class="clear"></div></div>');
</code></pre>
| javascript jquery | [3, 5] |
2,073,081 | 2,073,082 | Links and on click in ListView? | <p>i used <code>android:autoLink="web"</code> in textview inside a listView, the problem when the listview have a link, it looks like the <code>android:autoLink="web</code>" override the on click function for that listview .
What i need is to be able to click the link and able to click on the listview that contains the link .</p>
| java android | [1, 4] |
3,075,914 | 3,075,915 | equivalent of OnSelect javascript hook in multi-select asp listbox | <p>I have a multi-select <code><asp:listbox></code> and a button. I want to disable the button unless >= 1 item in the listbox is selected. How can I do this client-side? I can't find some sort of <code>OnSelect</code> callback, only <code>OnSelectedIndexChanged</code> which from googling seems complicated to use for this behavior, possibly impossible.</p>
| asp.net javascript | [9, 3] |
1,840,514 | 1,840,515 | Manual sort objects with anonymous type? | <p>I have the following code:</p>
<pre><code>var categories = catList.Select(c => new
{
Title = c.Web.Title,
Byline = c[Constants.FieldNames.Byline],
Url = c[SPBuiltInFieldId.FileRef]
});
</code></pre>
<p>I will always have maximum three items but could be less.
The Title will always be either (simplified) america, europe or africa</p>
<p>What I need to do is to sort them but not alphabetically before I add databind them to a repeater</p>
<p>The order I need to display them in is</p>
<pre><code>europe
africa
america
</code></pre>
<p>How can I achieve this?</p>
<p>thanks in advance.</p>
| c# asp.net | [0, 9] |
850,234 | 850,235 | Annoying exception in asp.net | <p>everybody; I have this problem in asp.net, I have a page where I insert and modify data, before saving I make a validation if it passes I save the data but if not I raise an exception and show it, the function goes like this;</p>
<pre><code>protected void btnSave_Click(object sender, EventArgs e)
{
try
{
...
if(ValidData())
//Save
...
else
throw new Exception("Invalid data");
}
catch(Exception ex)
{
// Javascript alert
JSLiteral.Text = Utilities.JSAlert(ex.Message);
}
}
</code></pre>
<p>The problem is that after I raise the exception and fix the data in the page I click again the save button and it saves but before it shows me again the exception message and its annoying. Even when the data is saved I click again and it shows the message from the exception again.</p>
<p>Do you know the answer for this issue?</p>
| c# asp.net | [0, 9] |
1,658,760 | 1,658,761 | Android where to initialize activity data? | <p>I want to do initialization when activity starts. </p>
<p>I can put it in <code>onCreate</code> method, but it is called every time <code>screenOrientation</code> is changed.
I can disable this in <code>AndroidManifest</code>, but maybe there is better solution for this? </p>
| java android | [1, 4] |
5,440,097 | 5,440,098 | How to created 2d array/arraylist with different types of data in each dimension in JAVA? | <p>I have a native Android news App where I have news articles and comments under each article.</p>
<p>When I open the inner View(Activity) of any specific article there might be different coverages of the same article, e.g. the Coverage from CNN, BBC, FOX ...etc.</p>
<p>Each coverage is actually treated as a different article with Unique String ID/Hash.</p>
<p>My background is Perl/PHP I'd like to know how do I create something like this in java:</p>
<pre><code>$array["Article1_Coverage_X"] = array($Comment1,$Comment2,$Comment3);
$array["Article1_Coverage_Y"] = array($Comment1,$Comment2,$Comment3,$Comment4);
// $Comment1 , $Comment2 ....etc are comment objects
</code></pre>
<p>.
.
i.e. the first dimension of the array is a string(key) and the 2nd dimension is of other type</p>
<p>I tried the following but it's not what I'm looking for:</p>
<pre><code> ArrayList<ArrayList<Comment>> // Where Comment is a Java object with ID,Title.....etc
</code></pre>
<p>As the keys for both dimension are indexed integers</p>
<p>if there's a better approach I'd highly appreciate it.
I want to store the list of comments related to each news article in a temporary variable such that it's (recycled/thrown to garbage) once the user quits the Activity, that's why I don't wanna store in an SQLite db.</p>
| java android | [1, 4] |
2,342,237 | 2,342,238 | selecting textViews and getting their values | <p>I am trying to accomplish following things</p>
<p>Suppose I have 5-6 <code>TextViews</code> with values <code>S N A K E</code> </p>
<p>Now, I want to press <code>S</code> textView then slide my finger over <code>N</code> to select it too and then move my way to E. I want to do that so that i can get "<code>SNAKE</code>" in my string or char sequence etc</p>
<p>If there is any idea do share me. I can't get it how to use <code>onTouch</code> here.
Also, i am adding <code>textViews</code> dynamically so i am setting their ids dynamically too
Best Regards</p>
| java android | [1, 4] |
5,747,541 | 5,747,542 | How make temp link download with resume? | <p>How can I create temporary link download with resume in asp.net with expire link after for example 2 days?</p>
<p>I use this:</p>
<pre><code>Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + "12.exe");
Response.TransmitFile(Server.MapPath("~/test/12.exe"));
</code></pre>
<p>But it's don't have resume and temp link.</p>
| c# asp.net | [0, 9] |
1,398,910 | 1,398,911 | Opening MS Word File | <p>I am using <code>document.Active()</code> method which is a part of <code>Microsoft.office.interop.word</code> namespace. I want to open the file i.e. I want to see the file opened in the Word application. I have set <code>thetrackRevisions</code> property true and rest of all the things. </p>
<p>I just want the file to open NOT IN SAVE-AS MODE. Just open so that when I open up a document from DB or from my PC drives I just want it to open. </p>
<p>Here is the code that I am executing:</p>
<pre><code>Word.Document tempDoc = app.Documents.Open("E:\\xyz.docx");
// Activate the document so it shows up in front
tempDoc.Activate();
tempDoc.TrackRevisions = true;
foreach (Revision rev in tempDoc.Revisions)
{
string editedBy = rev.Author;
//string what = rev.Cells;
}
tempDoc.Close(ref Nothing, ref format, ref Nothing);
</code></pre>
<p>Any suggestions that come to your mind?</p>
| c# asp.net | [0, 9] |
4,780,483 | 4,780,484 | $('#select').val() retuns UNDEFINED | <p>I have written some jQuery code, this is a part of it. this always return <strong>UNDEFINED</strong>. why is that</p>
<pre><code><html>
<head>
<script src="theme/js/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#my").click(function() {
alert($("#adults").val());
});
});
</script>
</head>
<body>
<form>
<a href="#" id="my">click</a>
<select class="text" id="currency" id="adults">
<option value="1" selected="selected">1</option>
<option value="2" >2</option>
<option value="3" >3</option>
<option value="4" >4</option>
</select>
</form>
</body>
</html>
</code></pre>
<p>This is used to get how many adults are there. Can't run without it.</p>
| javascript jquery | [3, 5] |
3,313,521 | 3,313,522 | No echo appearing of text input and $_FILES variable | <p>I want to know what is the correct way of display a text input in an echo in the code below because nothing is being outputted:</p>
<pre><code><script language="javascript" type="text/javascript">
window.top.stopVideoUpload(
<?php echo $result; ?>,
'<?php echo "<input name='vidid' type='text' value='$id'/> " . $_FILES['fileVideo']['name'] ?>'
);
</script>
</code></pre>
<p>Another attempt that didn't work:</p>
<pre><code><script language="javascript" type="text/javascript">
return window.top.stopVideoUpload(
<?php echo $result; ?>,
'<?php echo "<input name='vidid' type='text' value='".$id."'/>" . $_FILES['fileVideo']['name']; ?>'
);
</script>
</code></pre>
<p><strong>UPDATE:</strong></p>
<pre><code><script language="javascript" type="text/javascript">
window.top.stopVideoUpload(
<?php echo $result; ?>,
'<?php echo "<input name='vidid' type='text' value='".$id."'/>" . $_FILES['fileVideo']['name']; ?>'
);
</script>
</code></pre>
<p>The error I am recieving is: <code>syntaxError: missing ) after argument list.</code></p>
| php javascript | [2, 3] |
5,961,387 | 5,961,388 | Call PHP function from android? | <p>I want to call specific php function on server from Android application and also to send some parameters. Till now I achieved that I can open php file using HttpClient and executed data transfer to Json and show that in my app. So, now I want to be able to call specific function and send parameter to it, how can I do that??
Thanks.</p>
| java android | [1, 4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.