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 |
---|---|---|---|---|---|
5,958,331 | 5,958,332 |
cross site scripting
|
<p>Can I call a URL from a different host and write a variable to it without running into XSS security issues? This is what i am trying to do-</p>
<p>Send usernames + load a url in iframes from my site to a different site. I am doing this in javascript. I am actually able to do this but I am reading that browsers should be blocking it and its possibly a security concern? </p>
|
php javascript
|
[2, 3]
|
3,559,617 | 3,559,618 |
Paging in listview control
|
<p>Can I have some tutorial/sample code of using datapager in a asp.net listview control?</p>
|
c# asp.net
|
[0, 9]
|
4,334,976 | 4,334,977 |
Is it possible to apply an onclick() event to a div tag?
|
<p>To make sure that an event handler is written properly, I generally have Visual Studio generate the event for me. However, I can't find a way to do this with a div and I've tried typing it out myself to no avail. Is this even possible without writing any javascript? (I saw similar questions, but couldn't seem to find anything that fit my need).</p>
<p>Edit: Basically I have a logoff div disguised to the user as a button. When they click it, I want the following to happen:</p>
<pre><code> protected void LogOff_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Session.Abandon();
//This will clear the authentication cookie
HttpCookie myHttpCookie = new HttpCookie(FormsAuthentication.FormsCookieName, "");
myHttpCookie.Expires = DateTime.Now.AddYears(-1);
Response.Cookies.Add(myHttpCookie);
//This will clear the session cookie (not required for my application but applying to be safe)
HttpCookie myHttpCookie2 = new HttpCookie("ASP.NET_SessionId", "");
myHttpCookie2.Expires = DateTime.Now.AddYears(-1);
Response.Cookies.Add(myHttpCookie2);
FormsAuthentication.RedirectToLoginPage();
}
</code></pre>
<p>Here's where I call this event (sorry, it's technically a span, not a div): </p>
<pre><code> <a href="Log_In.aspx"><span class="MenuItem" runat="server" onclick="LogOff_Click">Log Off</span></a>
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,705,419 | 5,705,420 |
How do I replace the entire HTML node using jQuery
|
<p>I have a string which looks like:</p>
<pre><code><html><head><title>example</title></head><body>some example text</body></html>
</code></pre>
<p>I get this string returned as a result to an AJAX request.</p>
<p>I would like the browser to render and display that string. The idea would be to do something like: </p>
<pre><code>$('html').parent().html(myString);
</code></pre>
<p>Well, that doesn't work. I've attempted to use an IFRAME but I haven't figured out how to get that to work either.</p>
<p><strong>Note:</strong> It is impossible for me to change this string. It is also impossible for me to regenerate this string in a subsequent call to the server (otherwise I could just redirect the browser to that url).</p>
|
javascript jquery
|
[3, 5]
|
4,290,185 | 4,290,186 |
Problem in event generation of dynamically generated CheckBox
|
<p>I have a datagrid with dynamically generated checkbox column..I am not able to
generate the checkedChanged event for the checkbox..</p>
<p>Here is my code:</p>
<pre><code>public class ItemTemplate : ITemplate
{
//Instantiates the checkbox
void ITemplate.InstantiateIn(Control container)
{
CheckBox box = new CheckBox();
box.CheckedChanged += new EventHandler(this.OnCheckChanged);
box.AutoPostBack = true;
box.EnableViewState = true;
box.Text = text;
box.ID = id;
container.Controls.Add(box);
}
public event EventHandler CheckedChanged;
private void OnCheckChanged(object sender, EventArgs e)
{
if (CheckedChanged != null)
{
CheckedChanged(sender, e);
}
}
}
</code></pre>
<p>and Here is the event</p>
<pre><code>private void OnCheckChanged(object sender, EventArgs e)
{
}
</code></pre>
<p>Thanks In advance</p>
|
c# asp.net
|
[0, 9]
|
3,343,957 | 3,343,958 |
Is it possible to change button postbackurl via javascript?
|
<p>I have a sever control button.
Is it possible to set postbackurl of the button via javascript?</p>
<pre><code><asp:Button name="Button1" ID="Button1" runat="server" Text="Search" OnClick="Button1_Click" OnClientClick="return searchSubmit();" PostBackUrl="" >
</code></pre>
|
javascript asp.net
|
[3, 9]
|
4,973,223 | 4,973,224 |
php---how the site publish the thumbnail
|
<p>i want to konw how this site (www.retailmenot.com)publish the thumbnail. the thumbnails are under "Today's Top Coupons" part.do they first use a screenshot software to get the site image down and save it then publish it. but this way will have too trouble.am i right? </p>
|
php javascript
|
[2, 3]
|
3,099,443 | 3,099,444 |
Change picture on mouse hover
|
<p>How to set in <code>ASP.NET</code> for <code>ImageButton</code> to change picture on mouse hover?</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,464,330 | 3,464,331 |
javascript works on IE but doesnt on firefox and chrome
|
<p>This piece of javascript code works only on IE why and how can i make it work on firefox and chrome.
Thanks in advance.</p>
<p>Javascript</p>
<pre><code> function uploadFileChange() {
if (document.getElementById('textbox1').value != document.getElementById("FileUpload1").value) {
document.getElementById('textbox1').value = document.getElementById("FileUpload1").value;
}
return false;
}
</code></pre>
<p>HTML/asp.net</p>
<pre><code><div class="fileinputs">
<!-- Upload file invisivel-->
<asp:FileUpload ID="FileUpload1" ClientIDMode="Static" class="file" runat="server"
onpropertychange="uploadFileChange();" />
<!-- button e textbox falsas para poder dar syles ao button-->
<div class="fakefile">
<asp:TextBox ID="textbox1" CssClass="textbox" ClientIDMode="Static" runat="server"
Width="31%" ReadOnly="true" />
<asp:Button ID="FileChooserButton1" CssClass="btnSubmit" runat="server" Text="Procurar..."
ForeColor="White" />
<asp:Button ID="FileChooserButton2" CssClass="btnSubmit" Text="Apagar" ForeColor="White"
OnClientClick="clear();" runat="server" />
</div>
</div>
</code></pre>
<p>RESOLVED</p>
|
javascript asp.net
|
[3, 9]
|
4,140,565 | 4,140,566 |
Why can't I figure out the width of elements with automatic widths?
|
<p>I am trying to create a sideways slideshow of images. The panel that will contain the slideshow is exactly 1200px wide. At page load, PHP loads images inside this panel. The number of images is not always the same, and I don't want the slideshow to start unless the collective width of the loaded images exceeds the width of the 1200px container.</p>
<p>The problem is, all the images are of various sizes, everything from 150x100 to 1980x1200. The images are fit into the bar by setting their height to 50 and letting their width rescale automatically.</p>
<p>Now, creating this slideshow panel in any other programming language would be easy. I'm suffering here in javascript though, because I simply can't find ANY WAY of getting the new width of the images. They all read width: 0px using jQuery outerWidth()</p>
<p>I have even tried putting a div wrapper inside the 1200px panel, outside the images, hoping that div would automatically scale around the width of the images and give me their collective width, but instead it reads 1200px (jQuery outerWidth())</p>
<p>Is there any way of measuring their width?<br />
Is there an easier way of doing this?</p>
<p>Any help appreciated</p>
|
javascript jquery
|
[3, 5]
|
3,404,307 | 3,404,308 |
C# ASP.net how to get the server IP Address?
|
<p>Is there a 1 line method to get the IP Address of the server?</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
4,535,350 | 4,535,351 |
Converting code from JS to Jquery
|
<p>I found a bit of code to run a tool bar and need a bit of help converting it to jquery so I can use my existing code with it.</p>
<pre><code>scroll_final=document.body.scrollTop;
scroll_final=document.documentElement.scrollTop;
var toolbarid=document.getElementById('toolbar');
toolbarid.style.visibility='hidden';
toolbarid.style.opacity='1.00';
toolbarid.style.filter='alpha(opacity=100)';
toolbarid.style.visibility='visible';
</code></pre>
<p>As always...thank you for your help,
Todd</p>
|
javascript jquery
|
[3, 5]
|
3,617,201 | 3,617,202 |
jQuery: setInterval function stops working without reason
|
<p>I've problem with setInterval() function.</p>
<p>I want the text to change color every few seconds (please don't ask me why).
I came up with an idea to use jQuery setInterval() function to achieve that, but it doesn't work as I would expect.</p>
<p>The HTML:</p>
<pre><code><a href="skup" id="highlight">Highlighting text</a>
</code></pre>
<p>The CSS:</p>
<pre><code>a#highlight{
color: #000000;
text-decoration: none;
}
</code></pre>
<p>And the JS:</p>
<pre><code> setInterval(function() {
$('#highlight').css('color','#F79239');
setTimeout(function(){$('#highlight').css('color','#000000');},2000);
}, 2000);
</code></pre>
<p>jsFiddle link: <a href="http://jsfiddle.net/wbupY/" rel="nofollow">http://jsfiddle.net/wbupY/</a></p>
<p>As you can se the function stops working after few changes of color.
What could be the reason for this?</p>
<p>Or maybe you can suggest some other solution?</p>
|
javascript jquery
|
[3, 5]
|
4,416,852 | 4,416,853 |
How to display multiple pages under tabs similar to a Browser tab retaining loaded pages
|
<p>We have an application where we have a single level navigation menu with some heavy-duty pages on each link. The user can switch back and forth between these pages frequently to obtain information that he needs.</p>
<p>Once the page gets generated, it wouldn't change for the session. However, the page is specific to the user, hence we cant cache it. </p>
<p>I was trying to come up with a solution where we generate the page once, and keep it hidden in the background until its link is clicked, but haven't been able to get my head around this. </p>
<p>One of the ways I thought was to have multiple <code>div</code> tags (one for each page) on one page and keep toggling the <code>visibility</code> as the links are pressed, but that would end up making this single page very heavy. Someone also suggested using <code>iFrames</code>, but I am not really comfortable using the <code>iFrames</code> much and I'm not even sure, if it would be any helpful either.</p>
<p>Can you guys please suggest a few approaches to tackle the issue? </p>
<p><strong>update:</strong> Just to clarify, we are fine with keeping the pages separate and navigate across using a standard menu bar. We were just looking for ways to optimize the performance as we know that the pages once generated wouldn't change and there should be some way to tap that benefit.</p>
|
c# asp.net
|
[0, 9]
|
2,000,144 | 2,000,145 |
jQuery slider animate
|
<p>I want to create a slider with jquery animate and I can't think of how to rotate and animate the next elements here is my HTML</p>
<pre><code> <div id="slider">
<a href="http://somthing/" target="_blank">
<img src="http://something/logosponso.jpg" title="Another" />
</a>
<a href="http://somthing2/" target="_blank">
<img src="http://something/logosponso2.jpg" title="Another" />
</a>
…
…
</code></pre>
<p>I have the first a tag hidden in the css</p>
<pre><code> #slider a{
display: none;
}
</code></pre>
<p>What I want to happen is after 4 seconds of delay I fading in or slide in with some animation the next a tag and hiding the current. I want to do this until I get to the last a tag then I want to circle back around to the first a tag</p>
<p>I have this so far and not sure if I am heading in the right direction…any ideas?</p>
<pre><code>$("#slider a").fadeIn(500).delay(3000)
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,704,578 | 1,704,579 |
send two argument by postback
|
<p>I use the <code>__dopostback</code> function in javascript page to send some information to the <code>RaisepostbackEvent()</code> method in my c# page.</p>
<p><code>RaisepostbackEvent()</code> method accepts just one string argument, but I want to send two string arguments.</p>
|
c# javascript
|
[0, 3]
|
5,933,806 | 5,933,807 |
How to send variable to php from javascript and return the result back to JS
|
<p>I have this code.</p>
<pre><code>var book = document.getElementById('txtBook').value;
switch(book.toUpperCase())
{
case "GEN": var bk = "101"; break;
case "EXO": var bk = "101"; break;
case "LEV": var bk = "101"; break;
case "DEU": var bk = "102"; break;
... and so on...
}
</code></pre>
<p>I want to replace my <code>switch</code> with a database query. Since I learn from searching here that I can't do it straight from JS, I need to pass it to php Variable.</p>
<p>I want to know how to pass my <code>var book</code> to a php page like for example getbook.php</p>
<p>I will then make a query on php side. I want that result back to my JS for further processing.</p>
<p>I prefer method with no page refresh required.</p>
<p>Thanks</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,911,827 | 2,911,828 |
changing href doesn't work
|
<p>i like to <strong>add query string dynamically</strong> in in url. the whole table is from
<strong>jquery Datatable</strong></p>
<p>when i change select box(on change) ,
i need to add <strong>this</strong> value to all anchors in td.so i did that, through following code.
when i alert <strong>href</strong> i getting what i want</p>
<blockquote>
<p>("XXX?YY=YY&bsort=ZZ")</p>
</blockquote>
<p>.
but the anchor href's doesn't have that (&bsort=XX) query string(checking by fire bug)
whats wrong ?</p>
<p>mycode</p>
<pre><code>$('select[name="category_table_length"]').change(function(){
var b,href;
b = $(this).val();
$('td a').each(function(){
href = $(this).attr('href');
href = href+"&bsort="+b;
$(this).attr('href',href);
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,899,343 | 5,899,344 |
make jquery use min-height not just height
|
<p>The code:</p>
<pre><code>function setEqualHeight(columns)
{
var tallestcolumn = 0;
columns.each(
function()
{
currentHeight = $(this).height();
if(currentHeight > tallestcolumn)
{
tallestcolumn = currentHeight;
}
}
);
if (tallestcolumn <= 1000) {
columns.height(tallestcolumn + 4);
}
}
$(document).ready(function() {
setEqualHeight($("#main-content-bottom-bg > div"));
});
</code></pre>
<p>I know its probably simple, but I just cannot figure out what I give. I would think something like this:</p>
<pre><code>columns.minheight(tallestcolumn + 4);
</code></pre>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
1,748,104 | 1,748,105 |
write javascript to page based on a condition
|
<p>I need to remove some Javascript code based on a server side condition (PHP). What I currently have is a variable holding the Javascript code as text and based on the condition I either echo it or not. However, it's cumbersome to maintain. How do I go about doing it?</p>
<p>I also tried to use something like what follows, but it's not working.</p>
<pre><code><?php if(condition) { ?> <script> stuff here </script> <?php } ?>
</code></pre>
<p>I'm sorry for the formatting, I have no idea why the less-then sign is making the entire line disappear.</p>
|
php javascript
|
[2, 3]
|
4,780,899 | 4,780,900 |
Fetch posts from db-table, do math and THEN sort <- how?
|
<p>For fetching some db-posts (int) and then multiplying with user input-values I use php. </p>
<pre><code>$result = mysql_query("SELECT * FROM table")or die("Error" . mysql_error());
while($row = mysql_fetch_array($result)){
$value1=$row['value1'];
$value2=$row['value2'];
$value3=$row['value3'];
$product1=$value1*$userinput1;
$product2=$value2*$userinput2;
$product3=$value3*$userinput3;
}
</code></pre>
<p>[Now show results sorted by e.g. product1 ASC]</p>
<p>HOW?</p>
<p>Also how to make it possile to let the user change to e.g. sort by product2?</p>
<p>How can I then show the resluts, sorted by the sum of the user in put and one value from the row. And also give the user the possibility to change which value and user-input sum to sort by.</p>
|
php javascript
|
[2, 3]
|
5,139,598 | 5,139,599 |
What is the best way to display string items stored in Enumerable<string> object?
|
<p>This may seem an easy question, but is there a best way in terms of the method or syntax for displaying items stored in an Enumerable object of type string in a TextBox? (and other controls)</p>
<p>I have the following code:</p>
<pre><code> if (CategoryTypes.Count() >= 1)
{
foreach (var category in CategoryTypes)
{
txtCategories.Text += category + ", ";
}
}
</code></pre>
<p>Is there a better way of doing this?</p>
|
c# asp.net
|
[0, 9]
|
2,968,178 | 2,968,179 |
Array or someother collection where i can store multiple types
|
<p>I have a set of information that I need to store in some kind of collection, the problem is that i am not allowed to create a separate class for it because they say "i could mess up the structure and design of other things" so I have an integer and a string and what I want to do is to be able to store them like this</p>
<pre><code> index or similar int string
index[0] | 1 | "Bear, Person, Bird"|
index[1] | 2 | "Pear, Apples, Lime"|
</code></pre>
<p>The question is, is there a collection of some type for which I can store data like this without the need of a class so that i can reference it like this</p>
<pre><code>myWeirdList.add(2,"Test, test, Test, test");
</code></pre>
<p>or</p>
<pre><code>myWeirdArray.add(3,"roco,paco");
</code></pre>
<p>I hope the questions is clear if not I will keep an eye to better clarify..</p>
|
c# asp.net
|
[0, 9]
|
4,547,397 | 4,547,398 |
jquery using this to access object context when inside callback
|
<p>Let us presume I have the following object defined:</p>
<pre><code>var myObj = function(){
this.hello = "Hello,";
}
myObj.prototype.sayHello = function(){
var persons = {"Jim", "Joe", "Doe","John"};
$.each(persons, function(i, person){
console.log(this.hello + person);
}
}
</code></pre>
<p>Problem is that inside $.each this refers to person but I would like to access the obj property hello. </p>
<p>The only solution which i could find was declaring in sayHello function something like </p>
<blockquote>
<p>var _this = this;</p>
</blockquote>
<p>and then in $.each i would use something like </p>
<pre><code>console.log(_this.hello + person);
</code></pre>
<p>But unfortunately, this is not very good code. Is there another way to resolve this problem elegantly ?</p>
|
javascript jquery
|
[3, 5]
|
1,351,049 | 1,351,050 |
Javascript/jquery Images slideshow does not work
|
<p>I am trying to create an easy slideshow but It is not that easy at all :(.</p>
<p>I have few problems to make it work.</p>
<p>Here is my code so far: <a href="http://jsfiddle.net/WUE9g/1/" rel="nofollow">http://jsfiddle.net/WUE9g/1/</a></p>
<p>PS: I would much appreciate any kind of help.</p>
<p>Thank you! </p>
|
javascript jquery
|
[3, 5]
|
5,291,864 | 5,291,865 |
Import yahoo Contacts using Javascript
|
<p>our website use all contacts from yahoo,gmail,hotmail.but in gmail,and hotmail have JavaScript code get me . but how to get all contacts from yahoo using JavaScript .</p>
<p><strong>How To Get All Contact From Yahoo Using JavaScript ?</strong></p>
<p>Please help me .....</p>
|
javascript jquery
|
[3, 5]
|
2,463,716 | 2,463,717 |
How can I ensure that a link's default action is always disabled?
|
<p>I'm working on a project where I'm using a lot of ajax calls to make the the site interaction more elegant. The process I have been using is to have the link to the script that executes the appropriate action stored as the href in a link tag. I then use jquery to target that element and disable the default action and execute the ajax call. </p>
<p>The problem is that on occasion the <code>$(document).ready()</code> function doesn't properly execute or is delayed in executing before a user can click the links. This results in the page being opened via normal browser load. </p>
<p>I have implemented code that detects if the code is being executed via ajax or via the browser so all that happens is that a blank page is loaded. In some cases I can have it detect the execution type and respond differently but in other cases, if it's not executed by ajax then it causes problems. </p>
<p>Is there a way to ensure that the link's default action is disabled at all times regardless of the page's loading progress or is there a better approach than the one I'm taking?</p>
|
javascript jquery
|
[3, 5]
|
2,037,247 | 2,037,248 |
jquery text input box pass to variable
|
<p>This is my first time using jquery and while this is a fairly simple task I'm stuck already.
I've got a input box with the time of day in it. I would like to create a button to grab the time and send it to a variable (setTime) so I can use the time elsewhere in the script.
However I'm having trouble the variable to pass, I've added an alert window but all I get is either a blank alert or an "undefined" alert.
The first line <p> Start Time.... works fine its the setTime stuff that's broken.</p>
<p>Page header:
<code>setTime = $('#setTime').text();</code>
$('#formTime').timeEntry({show24Hours: true});</p>
<p>Page body:</p>
<pre><code><p>Start Time <input type="text" size="2" id="formTime" class="spinners" value="" /> </p>
<input type="button" value="Set Time" onclick="$('#setTime').val('#formTime');" />
<input type="button" value="Show Date" onclick="alert(setTime);" />
</code></pre>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
1,474,223 | 1,474,224 |
I need to users to enter a time in one format, convert it to another, perform a calculation, then bring it back again
|
<p>I am building an app that will convert swimming times from yards to meters, and can't figure out some important stuff.</p>
<p>I need a user to enter a time as this: <code>minutes:seconds.hundredths</code><br>
But it has to come to me in milliseconds, so that I can perform the conversion. After that I need to put it back into that format and display it to the user.</p>
<p>For example, if someone swam a 200 yard Freestyle in 1:52.43, I need to figure out how to multiply it by 1.11 and add 3.2 seconds, then display it to the user as their converted time for a 50 meter length pool.</p>
|
java android
|
[1, 4]
|
2,378,308 | 2,378,309 |
Communication by JSFIDDLE with PHP code and database on server
|
<p>I want communication by <strong><a href="http://jsfiddle.net" rel="nofollow">JSFIDDLE</a></strong> (jQuery AJAX call => url:...) with PHP code in my server but have following error.<p></p>
<blockquote>
<p>An error has occured:<br> [object Object]<br> error<br></p>
</blockquote>
<p><strong>Demo:</strong> <a href="http://jsfiddle.net/mmJNq/" rel="nofollow">http://jsfiddle.net/mmJNq/</a></p>
<p>what do i do?</p>
<pre><code>$('.eghamat').live('keyup', function () {
var $this = $(this),
$div = $this.closest('div.bg_units'),
bu_num = '.' + $div.attr('class').split(" ")[1];
var dataObj = $(this).closest('form').serialize();
//alert(dataObj);
$.ajax({
type: "POST",
dataType: 'json',
url: 'http://binboy.gigfa.com/admin/tour_foreign/auto_complete',
//url: 'auto_complete',
data: dataObj,
cache: false,
success: function (data) {
//alert(bu_num);
var id_name = $(bu_num + ' .list_autobox_hotel').attr('id');
$(bu_num + ' .list_autobox_hotel').show().html('');
if (data == 0) {
$(bu_num + ' .list_autobox_hotel').show().html('<p><b>there is no</b></p>');
} else {
$.each(data, function (index, value) {
$('<p id="' + value.name + '">' + value.name + '</p>').appendTo('.list_autobox_hotel');
});
}
},
"error": function (x, y, z) {
// callback to run if an error occurs
alert("An error has occured:\n" + x + "\n" + y + "\n" + z);
}
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
602,557 | 602,558 |
jQuery(document).ready() does not fire
|
<p>Does anyone know why jQuery document ready might not fire on a website? I put exactly this script in footer and it simply doesn't fire (jQuery 1.8 is included in head section):</p>
<pre><code><script type="text/javascript">
jQuery(document).ready(function() {
alert('test');
jQuery("#slideshow iframe").each(function(){
alert('test');
});
});
</script>
</code></pre>
<p>There are no Javascript errors, console is empty and when I run this in Firebug's console it works:</p>
<pre><code>jQuery("#slideshow iframe").each(function(){
alert('test');
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,493,867 | 3,493,868 |
Upload a dynamic page to server
|
<p>I have a page that contains a table that the user can update. This has been done using javascript. </p>
<p>When the user has finised updating, I want to have the raw HTML page uploaded to the server, and then the user will be redirected to a php page which will do some final processing and spit out a report.</p>
<p>Is this possible or should I come up with another method of reaching the same end... and if so how do I get the dynamically created HTML onto the server to be manipulated?</p>
|
php javascript
|
[2, 3]
|
3,277,629 | 3,277,630 |
update datatable inside a dataset
|
<p>I want to know how to update a Datatable which is inside a dataset.I have a datatable in which i have details of some item.Now i want to add this into a dataset for some purpose and update it.Give me some suggesions to solve this..</p>
<p>this is my code:</p>
<pre><code> DataRow dr;
dr = Basket_DataTable.NewRow();
Basket_DataTable.Rows.Add(dr);
dr["PId"] = getPId.ToString();
dr["ProductName"] = getProductName.ToString();
dr["ImagePath"] = getImagePath.ToString();
dr["ProductPrice"] = getProductPrice.ToString();
dr["Quantity"] = getQuantity.ToString();
dr["ProductDescription"] = getProductDescription.ToString();
dr["TotalPrice"] = getProductPrice.ToString();
Basket_DataTable.AcceptChanges();
</code></pre>
<p>Basket_DataTable is my datatable which i need to add to a dataset and update.. </p>
|
c# asp.net
|
[0, 9]
|
3,626,449 | 3,626,450 |
making table cells clickable
|
<p>i currently have a table of about 30 rows and i would like to make td clickable in each case:</p>
<pre><code><tr height="100px" align="center">
<?php do { ?>
<td style="background-color: <?php echo $row_dd1['colour']; ?>;">
<form action="pay.php?id=<?php echo $row_dd1['dNo']; ?>&user=<?php echo $username; ?>" method="post">
<input type="hidden" id="<?php echo $row_dd1['dNo']; ?>"><input type="hidden" value="<?php echo $username; ?>">
<button type="submit" class="link" id="t<?php echo $row_dd1['dNo']; ?>"><span><?php echo $row_dd1['dNo']; ?></span></button></form>
</td>
<?php } while ($row_dd1 = mysql_fetch_assoc($dd1)); ?>
</tr>
</code></pre>
<p>how do you make the table cell clickable? i would like it to have the same link as the form action that i have used which is:</p>
<pre><code><form action="pay.php?id=<?php echo $row_dd1['dNo']; ?>&user=<?php echo $username; ?>" method="post">
</code></pre>
<p>any help would be appreciated. much thanks and God bless!</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,133,680 | 5,133,681 |
parse through visual studio non-web project 2010 to get file listing
|
<p>I have looked into following links but the code or the approach is not clear to me.</p>
<p><a href="http://stackoverflow.com/questions/1172383/open-a-vs-2005-solution-file-sln-into-memory">Open a VS 2005 Solution File (.sln) into memory</a></p>
<p>I am trying to parse through a non web project to get list of files. Following code does not work for me because Server.MapPath is not available in a non-web project. Please let me know how I could do this. </p>
<pre><code> string[] filePaths = Directory.GetFiles(Server.MapPath("~/"), "*.*", SearchOption.AllDirectories);
foreach (string filepath in filePaths)
{
string[] folders = filepath.Split('\\');
string filename = folders[folders.Count() - 1];
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,419,357 | 2,419,358 |
Add onclick to all anchors on page except for ones with a specific class
|
<p>I'm sure this should be relatively easy to do with Jquery, but my attempts have not worked so far (I'm a little new at Jquery).</p>
<p>Can anyone help me, please?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,212,420 | 3,212,421 |
Static Variables somehow maintaining state?
|
<p>I am working on an existing project, setup by another coder. I'm having some trouble understanding how state is being maintained between pages. There is a Class library which has some helper objects. Mostly these objects are just used for there static methods and rarely instantiated or inherited.</p>
<p>This is an example class I'm testing with.</p>
<pre><code>public sealed class Application
{
public static string Test;
}
</code></pre>
<p>Now when i run something like the following in the base class of my page, I would expect the result to be "1: 2:Test" all the time (note that "1" is empty), but strangly its only this way the first time it is run. Then every time afterwards its "1:Test 2:Test". Somehow its maintaining the state of the static variable between pages and being refreshed??</p>
<pre><code>Response.Write("1:" + SharedLibrary.Application.Test);
SharedLibrary.Application.Test = "Test";
Response.Write(" 2:" + SharedLibrary.Application.Test);
</code></pre>
<p>I need to create more classes like this, but want to understand why this is occurring in the first place.</p>
<p>Many Thanks</p>
|
c# asp.net
|
[0, 9]
|
4,557,005 | 4,557,006 |
InvocationTargetException in constructor of a custom class
|
<p>I have a complicated structure to be displayed on the screen. Made with XML layouts. For the vertical orientation and portrait layouts are different.</p>
<p>If you flip the screen layouts are redrawn and initializes the GUI. On the horizontal layout I use <strong>CustomRelativeLayout</strong>, in which overrides <strong>onMeasure ()</strong>.</p>
<p>After a few quick revolutions display an error message from <strong>java.lang.RuntimeException: Unable to start activity ComponentInfo android.view.InflateException: Binary XML file line #146: Error inflating class </strong> This link goes to the element of my CustomRelativeLayout and lower <strong>Caused by: java.lang.reflect.InvocationTargetException</strong> with reference to the constructor of my custom class.</p>
<p>I suspect that activity simply has no time to be destroyed and start again, but how to fix it I have not the foggiest idea. I would be grateful for your help.</p>
|
java android
|
[1, 4]
|
2,889,226 | 2,889,227 |
php file loaded with jquery not displaying php variables
|
<p>I have a PHP file that contains a button. When the button is clicked an external PHP file is loaded into a div on the same page. The external PHP file contains a form with a hidden variable, the values is set to a PHP variable that was defined in the page with button.</p>
<p>Since the PHP file is loaded into the page's div shouldn't it have the same variables as the page?</p>
|
php jquery
|
[2, 5]
|
4,651,540 | 4,651,541 |
What causes a 40 second delay when running an executable using Process.Start()?
|
<p>I'm running an executable on the local file system using Process.Start() from an ASP.NET web application. This runs correctly and does what I expect it to, the problem is that it takes around 40 seconds before the exe starts after Process.Start() has been called.</p>
<p>When I run the exe from the command line it only takes a few seconds to complete its work.</p>
<p>Does anyone know what is causing this long delay when I use Process.Start()?</p>
<p>Thanks in advance!</p>
<p>Robert</p>
|
c# asp.net
|
[0, 9]
|
1,380,255 | 1,380,256 |
code not working properly after inserting large volume of data?
|
<p>I've a gridview for showing employees in standby mobilization.Initially around 2000 employees are loaded in gridview.My problem is that, in mobilization page,when we mobilize employees, data is inserting correctly,but fillgrid is not getting called</p>
<p>Its working fine in my local system,but not in the server.Is it because of large volume of data.Every other function is working correctly....</p>
<p>Heres my code for inserting</p>
<pre><code>int i = clsMob.InsertMobilizationDetails(dsMobilizn.GetXml());
if (i>0)
{
FillGrid();
ClearAll();
string str = "<script>alert('Successfully mobilized the selected employees')</script>";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Validation Error", str, false);
return;
}
</code></pre>
<p>Function InsertMobilizationDetails</p>
<pre><code>public int InsertMobilizationDetails(string xml)
{
Database_Operations dbo = new Database_Operations("TransMob_InDetails", true);
dbo.AddParameter("@xmlMob", xml);
return dbo.ExecuteQuery(); //returns value as 1
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,336,435 | 4,336,436 |
output with javascript/jquery
|
<p>I have a script that runs within the body. How can I make it output directly after itself. Similar to echo in php.</p>
<p>e.g.</p>
<pre><code> <div id="text">Text</div>
<div id="someotherdiv">
The text above says
<script>
$('#text').html().echo?;
</script>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,922,001 | 2,922,002 |
jQuery: stop a <select> list from moving on keypress?
|
<p>I have HTML/jQuery like this:</p>
<pre><code><select id="userlist" name="userlist">
<option value=''></option>
<option value="ADJUDICATION">ADJUDICATION</option>
<option value="ADMINISTRATIVE">ADMINISTRATIVE LAW</option> # etc
</select>
$("#userlist").keypress(function(e) {
windows_id += String.fromCharCode(e.which).toUpperCase();
// Only do anything if we have more than 1 initial.
if (windows_id.length > 1) {
// do stuff here
}
});
</code></pre>
<p>As you can see, if the user types more than two characters in, I want to do something special. </p>
<p>My question is this: is there any way I can prevent the <code><select></code> list from moving after the user has typed just one character, and instead, hold it still until the user has typed two?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,258,936 | 3,258,937 |
Remove class if checkbox is checked
|
<p>I want that <code>onload</code> the <code><span></code> and <code><checkbox></code> classes to be blank:</p>
<pre class="lang-php prettyprint-override"><code><span id="checkboxx_<?php echo $nrs['id']; ?>" class="highlight" >
<input type="checkbox" class="checkboxx" id="checkboxx_<?php echo $nrs['id']; ?>" style="padding: 0px; margin: 2px;" <?php echo $value == 1 ? 'checked="checked"' : ''?>>
</span>
</code></pre>
<p>i have tried this </p>
<pre class="lang-php prettyprint-override"><code><?php
if($value==1)
{
?>
<script>
if (this.checked) {
document.getElementById("checkboxx_<?php echo $nrs['id']; ?>").className = "";
}
</script>
<?php
} else {
?>
<script>$j("#"+pos).addClass("highlight");</script>
<?php
}
</code></pre>
<p>but this doesn't work.</p>
|
php javascript
|
[2, 3]
|
4,416,431 | 4,416,432 |
Function calculating newTime - oldTIme to add points to a var seems to fail
|
<p>I have the following code:</p>
<ul>
<li>A div called "tm" in here a timer is ticking, e.g. 00:03:34
(hh:mm:ss) </li>
<li>I have a function called <code>setScore();</code> which is called
regular</li>
<li>I have the following vars:</li>
</ul>
<p>1: <code>var pointsAvailable = 40;</code></p>
<p>2: <code>var oldTime = 00:00:00;</code></p>
<p>Now I want to ad 10 points to pointsAvailable every time the function is called within 2 seconds. If it's longer, pointsAvailable must be set back to 40. Since the timer keeps on ticking, oldTime (which is the starting time) should be replaced by newTime (every time the function has run).</p>
<p>I came up with the following code:</p>
<pre><code>var pointsAvailable = 40; //start value
var oldTime = 00:00:00; //start value
function setScore() {
var newTime = document.getElementById('tm').innerHTML; //get the time from div: 'tm' e.g. 00:00:02
var findTime = (newTime - oldTime); //calculate the time in between e.g. 00:00:02 - 00:00:00 = 2
if (findTime < 3) { //is it smaller then 3?
pointsAvailable += 10; //add 10 to the pointsAvailable
} else { //is it 3 or bigger?
pointsAvailable = 40; //set it back to 40
}
oldTime = newTime; //replace oldTime with newTime, so newTime becomes oldTime
}
</code></pre>
<p>But it isn't working. What am I doing wrong?</p>
<p>Kind regards,
Maurice</p>
|
javascript jquery
|
[3, 5]
|
5,758,892 | 5,758,893 |
Unable to start activity ComponentInfo: java.lang.NullPointerException
|
<p>i'm building an android application for my degree. i need to get all contacts from phone for
begin the apllication (later i need also to get emails etcetc). so i used two classes </p>
<p>Degree_thesisActivity</p>
<pre><code> public class Degree_thesisActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
GetFromPhone gf = new GetFromPhone();
gf.getContacts();
}
</code></pre>
<p>}</p>
<p>GetFromPhone.java</p>
<pre><code>class GetFromPhone extends Activity {
public void getContacts() {
// TODO Auto-generated method stub
/**Declare a Contacts Cursor which have a list of all contacts*/
Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
/**Move while cursor has another istance to process*/
while(cursor.moveToNext()){
/**Get the contact name pointed by cursor at that time*/
cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
String contactID = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
/**show the contact pointed.THIS WILL BE MODIFIED FURTHER!!!!*/
new AlertDialog.Builder(this)
.setMessage(contactID)
.setNeutralButton("ok", new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
})
.show();
}
}
</code></pre>
<p>}</p>
<p>but i get this error :</p>
<p>05-05 15:49:20.060: E/AndroidRuntime(824): java.lang.RuntimeException: Unable to start activity ComponentInfo{it.paki.degreethesis/it.paki.degreethesis.Degree_thesisActivity}: java.lang.NullPointerException</p>
<p>why?anybody can help me?</p>
|
java android
|
[1, 4]
|
3,431,409 | 3,431,410 |
Sanitizing string to url safe format
|
<p>I am trying to sanitize a string so that it can be used to be put in an URL. This is just for show in the URL. Now I was using this function in PHP which worked fine:</p>
<pre><code>$CleanString = IconV('UTF-8', 'ASCII//TRANSLIT//IGNORE', $String);
$CleanString = Preg_Replace("/[^a-zA-Z0-9\/_|+ -]/", '', $CleanString);
$CleanString = StrToLower( Trim($CleanString, '-') );
$CleanString = Preg_Replace("/[\/_|+ -]+/", $Delimiter, $CleanString);
</code></pre>
<p>Now I am trying to put this in C#, the regex's are no problem but the first line is a bit tricky. What is the safe way to replace characters as é á ó with their normal equivalents a e o?</p>
<p>For example, above would transer:</p>
<pre><code>The cát ís running & getting away
</code></pre>
<p>to</p>
<pre><code>the-cat-is-running-getting-away
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,322,764 | 4,322,765 |
Android - Display the loading text
|
<p>I am trying to display Loading text only when its loading.
The problem is im setting it to visible and straight after to invisible once finished loading. But text never has a chance to update. Is there a way to force refresh the screen, or maybe there is another way to do this?
Thanks</p>
<p>This is my code</p>
<pre><code>SearchBtn = (Button) findViewById(R.id.SearchButton);
SearchBtn.setOnClickListener(new OnClickListener()
{
public void onClick(View arg0)
{
//this is never seen because its set straight after to invisible
LoadingText.setVisibility(View.VISIBLE);
SearchFor(EditSearchField.getText().toString()); // all loading done here
LoadingText.setVisibility(View.INVISIBLE);
HideKeyboard();
}
});
</code></pre>
|
java android
|
[1, 4]
|
2,355,339 | 2,355,340 |
Why does my button output WebForm_DoPostBackWithOptions?
|
<p>I need my page to work when JavaScript has been disabled. But my button is outputting onclick="WebForm_DoPostBackWithOptions...". When I set CauseValidation="false" it disappears but I need validation. In what circumstances is WebForm_DoPostBackWithOptions outputted? And how can I get around this problem?</p>
|
javascript asp.net
|
[3, 9]
|
4,720,263 | 4,720,264 |
How to make a sliding thingamajig between photos?
|
<p>See the effect in the photos in the article here:</p>
<p><a href="http://www.popsci.com/science/article/2012-11/and-after-images-show-hurricane-sandys-devastation" rel="nofollow">http://www.popsci.com/science/article/2012-11/and-after-images-show-hurricane-sandys-devastation</a></p>
<p>Does anyone have any idea how that's done? I suppose I could make two frames with adjustable width within a fixed frame, but what about the handle? And the way the frame line and handle brighten and enlarge when you mouse over? Hover event, to be sure, but what kind of hover event?</p>
|
javascript jquery
|
[3, 5]
|
5,109,509 | 5,109,510 |
How to get values of textbox and dropdownlist controls in a gridview on a button click event?
|
<p>On the page load there will be gridview with a default row....there is a button with a + sign at the bottom...on the button click i want to create a new rows in the grid..before that i need to make sure that all fields have values.But I am getting null values..</p>
<p><img src="http://i.stack.imgur.com/bw0IK.png" alt="I want to get the value of textbox and dropdownlist controls (which are in a gridview)"></p>
<p>My code is:</p>
<pre><code>TextBox name_value = ((TextBox)Gridview1.Rows[0].FindControl("TextBox1"));
TextBox age_value = ((TextBox)Gridview1.Rows[0].FindControl("TextBox2"));
DropDownList sex_value = ((DropDownList)Gridview1.Rows[0].FindControl("DropDownList1"));
DropDownList berth_value = ((DropDownList)Gridview1.Rows[0].FindControl("DropDownList2"));
</code></pre>
<p>Any help will be appreciated.</p>
|
c# asp.net
|
[0, 9]
|
5,076,279 | 5,076,280 |
Simulate Android button click programmatically
|
<p>I've seen <a href="http://stackoverflow.com/questions/4553374/how-to-simulate-a-button-click-through-code-in-android">this</a> route,</p>
<pre><code>View.performClick();
</code></pre>
<p>but it doesn't show the actual press of the button. I've also tried <a href="http://stackoverflow.com/questions/6887674/android-button-programmatic-click">this</a> method,</p>
<pre><code>btn.setPressed(true);
btn.invalidate();
</code></pre>
<p>but, it just shows the button being pressed down. I've narrowed it down to this code, which presses down, and releases, but doesn't click. Am I missing something? How can I do a complete click as if though the user was clicking (monkeyrunner is not an option as of right now)</p>
<pre><code>btn = (Button) findViewById(R.id.btn_box);
Handler handler = new Handler();
Runnable r = new Runnable() {
public void run() {
btn.setPressed(true);
btn.invalidate();
Handler handler1 = new Handler();
Runnable r1 = new Runnable() {
public void run() {
btn.setPressed(false);
btn.invalidate();
}
};
handler1.postDelayed(r1, 1000);
}
};
handler.postDelayed(r, 1000);
</code></pre>
|
java android
|
[1, 4]
|
665,345 | 665,346 |
Trigger this script as page loads
|
<p>I have a jQuery script, which is triggered when a checkbox is selected (or deselected). It causes the whole page to be disabled, or enabled.</p>
<p>It is working as intended, but I have to start the page in "edit" mode.</p>
<p><strong>I need to be able to set if the page starts in edit mode, or disabled mode when the page initially loads.</strong> </p>
<p>I can easily pass a variable via PHP - but I'm not sure where/how to do it, or what to trigger?</p>
<p>This is my triggering script</p>
<pre><code><script>
$('#switch-enable').change(function()
{
if ($('#switch-enable').is(':checked')) {
$('#disabled-switches *').prop("disabled", false);
} else {
$('#disabled-switches *').prop("disabled", true);
}
} );
</script>
</code></pre>
|
php jquery
|
[2, 5]
|
5,175,709 | 5,175,710 |
NumberFormatException error from String to integer
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/13638938/string-to-integer-convertion">String to integer convertion</a> </p>
</blockquote>
<p>For one of my project I have to pass ineger value in this format "16:45:10". this format is in String. I am converting this to ineger like <code>int i = Integer.parseInt(string)</code> but it;s giving me error saying NumberFormatException error;</p>
<p>How to solve this.</p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
442,780 | 442,781 |
get dimentions of image while uploading
|
<p>While browsing and uploading images, I want to know the image's height and width and based on this I want to resize and show it. Can I achieve this with javascript?</p>
<p>I am trying this the following code but its working only in IE, any other solutions please?</p>
<pre><code> img_id++;
var id="imgid"+img_id;
image = document.getElementById('submit').value;
document.getElementById('div').innerHTML="<img id='"+id+"' src='"+image+"' >";
document.getElementById(id).style.visibility="hidden";
alert(document.getElementById(id).offsetWidth +'by'+document.getElementById(id).offsetHeight);
</code></pre>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
2,388,260 | 2,388,261 |
jQuery check external link
|
<p>Using Javascript or jQuery, how can I check if an external link is available? </p>
<p>An <code>$.ajax()</code> call is not available as it violates <a href="http://en.wikipedia.org/wiki/Same_origin_policy" rel="nofollow">SOP</a> (same problem as <a href="http://stackoverflow.com/questions/7234297/jquery-not-working-for-external-domains">here</a>). I have read about <a href="http://en.wikipedia.org/wiki/JSONP" rel="nofollow">JSONP</a>, but I would like to know if there is a more straight solution, as I don't want to load any data from the external server; what I need is only to check if it is reachable.</p>
<hr>
<p>EDIT (answer)</p>
<p>I solved it with the following code:</p>
<pre><code>$.ajax({url: 'http://www.example.com',
type: 'GET',
dataType: 'jsonp',
complete: function(jqXHR, textStatus) {
console.log(jqXHR.status); // '200' = url reachable
},
timeout: 2000
});
</code></pre>
<p>The only problem now is that I get a <code>Parse error</code>, but in any case it can be checked if the external link is working.</p>
|
javascript jquery
|
[3, 5]
|
442,475 | 442,476 |
control after unexpected shutdown
|
<p>I'm working on a program that sends a command to the server and creates a file on the server to let it know its connected for example, while the program is running it creates a file say "here" everytime it loops, a php site then checks the server for that file, if the file is there it knows the program is connected. However when it suddently stops say because the computer is shutdown, it might happen to shutdown when the file has been created, so say it shutsdown now in 5minutes if the server checks the file will be there, is there any way to have the program delete the file on unexpected shutdown? This is on C++.</p>
<p>thank,</p>
|
php c++
|
[2, 6]
|
4,333,237 | 4,333,238 |
Create variables with a For each loop - jquery
|
<p>I have the following</p>
<pre><code>var invest401_2 = $("input[type=hidden][name=invest401_2]").val();
var invest401_3 = $("input[type=hidden][name=invest401_3]").val();
var invest401_4 = $("input[type=hidden][name=invest401_4]").val();
var invest401_5 = $("input[type=hidden][name=invest401_5]").val();
var invest401_0label = Math.round(((invest401_0/balance401)* percent401kb));
var invest401_1label = Math.round(((invest401_1/balance401)* percent401kb));
var invest401_2label = Math.round(((invest401_2/balance401)* percent401kb));
var invest401_3label = Math.round(((invest401_3/balance401)* percent401kb));
var invest401_4label = Math.round(((invest401_4/balance401)* percent401kb));
var invest401_5label = Math.round(((invest401_5/balance401)* percent401kb));
$("#invest401_0").text(invest401_0label+'%');
$("#invest401_1").text(invest401_1label+'%');
$("#invest401_2").text(invest401_2label+'%');
$("#invest401_3").text(invest401_3label+'%');
$("#invest401_4").text(invest401_4label+'%');
$("#invest401_5").text(invest401_5label+'%');
</code></pre>
<p>Having the count total - ex. 5 </p>
<p>How do a throw this into a for each loop.</p>
<p>I tried but didnt work.</p>
|
javascript jquery
|
[3, 5]
|
3,124,624 | 3,124,625 |
jquery control a checkbox from another checkbox
|
<p>my check-boxes look like</p>
<pre><code><input type="checkbox" id="checkbox_1" name="artist" value="Yes">
<input type="checkbox" id="checkbox_2" name="song" value="Yes">
</code></pre>
<p>and my code is</p>
<pre><code>$(document).ready( function() {
$('#checkbox_1').click( function() {
$('#checkbox_2').each( function() {
this.checked = !this.checked;
});
$("#submit").click();
});
});
</code></pre>
<p>problem is when i check checkbox_1 it doesnt stay checked (it stays deselected).. after <code>$("#submit").click()</code>;</p>
<p>hope you get the ideea</p>
<p>ok ok ok ..</p>
<p>the desired effect is:</p>
<p>Step1: both checkboxes are cleared</p>
<p>Step2: if i select checkbox1 then both checkboxes are selected</p>
<p>Step2: if i deselect checkbox1 then both checkboxes are cleared again</p>
<p>get it ?</p>
|
javascript jquery
|
[3, 5]
|
4,274,251 | 4,274,252 |
How to get offset relative to a specific parent?
|
<p>I want to get the offset of an element relative to <em>a specific parent</em> not the direct one and not the document.</p>
<p>I looked for that on the internet and found the <a href="http://api.jquery.com/offset/" rel="nofollow">offset</a> and <a href="http://api.jquery.com/position/" rel="nofollow">position</a> JQuery methods. But seems they don't help me in my situation ( relative to a specific parent)</p>
<p>Any help!</p>
|
javascript jquery
|
[3, 5]
|
3,171,638 | 3,171,639 |
Changing button text of gridview
|
<p>I have a grid view which contains a button in a template field. I want to change the button text when the button click event is completed. Can somebody send me a sample code.</p>
<p>Thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
5,389,942 | 5,389,943 |
Detect if options menu is displayed when back button is pressed
|
<p>My back button is overridden for ... reasons. I've implemented a new feature, the options menu, and I need unique function calls if the back button is pressed while this options menu is up versus when it is not up. How can I discern if the menu is up when the back button is pressed? Thanks guys!</p>
|
java android
|
[1, 4]
|
2,809,962 | 2,809,963 |
Autocomplete jQuery & php problem
|
<p>i am trying to get a list of names from MySQL table useing php and jQuery autocomplete function but i get no result.could you help plz</p>
<p>here is jQuery </p>
<pre><code><html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"
type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function findmatch(str){
if (str.length>0){
$('#found').load('SelectQury.php?n='+str);
}
}//fun
</script>
</head>
<body>
<div id="container">
<input type="text" name="text" id="textfield" autocomplete="off"
onkeyup="findmatch(this.value);"/>
<div id="found" >non found</div>
</div>
</body>
</html>
</code></pre>
<p>php code</p>
<pre><code>if(isset($_POST['text'])){
$s=$_POST['text'];
$query="SELECT FROM student WHERE name LIKE '$s%'";
$result=mysql_query($query) or die ('Wrong query : ' . mysql_error() );
$string='';
while($row = mysql_fetch_assoc($result)){
$string.= $row['name'];
}
echo $string;
}else{
echo 'wrong GET keywoord';
}//ifisset
</code></pre>
|
php jquery
|
[2, 5]
|
5,174,810 | 5,174,811 |
jquery in included javascript file
|
<p>I am new to jquery and javascript so I haven't been able to figure this problem out; nor have my google-fu skills helping me today.</p>
<p>I developed a page with HTML and Javascript/Jquery, placing all the jquery between script tags and all was well. When I was done the page I realized that I wanted the same javascript on another page so I put all that jquery/javascript into an external file and tried to include it.</p>
<p>That's where things went downhill. The javascript doesn't work at all on the initial page. Nothing happens. I checked the error console and I am not getting any JS errors. </p>
<p>Why does this not work and how do I get it to work? </p>
<p>This is the JS code in the external file: <a href="http://pastebin.com/wHBmbHLs" rel="nofollow">http://pastebin.com/wHBmbHLs</a></p>
|
javascript jquery
|
[3, 5]
|
5,398,047 | 5,398,048 |
Can I use keyboard short cuts to use my website
|
<p>I am creating my website in asp.net 4 and would like to know if I can allow my user to use my website with his keyboard.</p>
<p>I want him to be allowed to have simple shortcuts similar to desktop applications such as saving with ctrl + s saves it.</p>
<p>I would want similar functionality in my website where he can maybe use shift + a and add a new product. shift + del to delete a product.</p>
<p>How can I achieve this ? With Jquery? does Asp.net provide an option?</p>
|
jquery asp.net
|
[5, 9]
|
4,966,262 | 4,966,263 |
Is jquery interface.js com always working with the new version of jQuery?
|
<p>On the interface.js website (<a href="http://interface.eyecon.ro/" rel="nofollow">http://interface.eyecon.ro/</a>) they propose to download interface.js with jquery 1.1.2. I would like to know if interface.js is still compliant with the new version of jquery and if there will be new release of this library.</p>
<p>I had some trouble to use jquery 1.2.x with interface 1.2, and using jquery 1.1.4 correct bugs I had.</p>
<p>Sorry for my bad english, hope someone understand my question ^^ </p>
|
javascript jquery
|
[3, 5]
|
524,630 | 524,631 |
add listener vs set listener
|
<p>What is the difference between adding a listener and setting a listener.</p>
<p>e.g.</p>
<pre><code>addTextChangedListener(textWatcher);
setOnClickListener(clickListener);
</code></pre>
<p><strong>Answer:</strong></p>
<p>After aioobe's answer i have tested this in my project.
So we can do this.</p>
<pre><code>editText.addTextChangedListener(textWatcher1);
editText.addTextChangedListener(textWatcher2);
</code></pre>
<p>but we can't do this.(It will set only the last listener in this case clickListener2)</p>
<pre><code>button.setOnClickListener(clickListener1);
button.setOnClickListener(clickListener2);
</code></pre>
<p><strong>Another doubt</strong></p>
<p>I am not able to think any use case in which i need two textWatcher for single editText. Can anybody give such a use case. (should i ask this question as separate question?)</p>
|
java android
|
[1, 4]
|
3,785,321 | 3,785,322 |
Revert style applied from focus after blur
|
<p>When a user focuses on a text field, I want that text in that text field to change colors (among several other properties). When the user leaves that field (blur), I want the text/style to appear as it was before the focus. Currently I am doing it in what seems to be a repetitious way.</p>
<pre><code>$('#name1').focus(function() {
$(this).css('color', 'red')
});
$('#name1').blur(function() {
$(this).css('color', 'black')
});
</code></pre>
<p>How would I do this something like:</p>
<pre><code>$('#name1').blur(function() {
$(this).beforeFocus();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,090,815 | 4,090,816 |
"AttributeError: 'module' object has no attribute 'argv'" when using Python.h
|
<p>When messing around with Python.h I got this error: </p>
<pre><code>AttributeError: 'module' object has no attribute 'argv'
</code></pre>
<p>C++ code: </p>
<pre><code>#include "stdafx.h"
#include "C:/Python27/include/Python.h"
#include <iostream>
using namespace std;
int main()
{
Py_Initialize();
PyRun_SimpleString("import sys\nprint sys.argv[0]");
}
</code></pre>
<p>Which in Python is:</p>
<pre><code>import sys
print sys.argv[0]
</code></pre>
<p>What am I missing?</p>
|
c++ python
|
[6, 7]
|
798,130 | 798,131 |
PHP variable inside a js file
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/393479/best-way-to-transfer-an-array-between-php-and-javascript">Best way to transfer an array between PHP and Javascript</a> </p>
</blockquote>
<p>How do I put the value of a PHP variable inside a Javascript variable?
This is what I have now in a js file:</p>
<pre><code>test=<?php echo $country; ?>;
</code></pre>
|
php javascript
|
[2, 3]
|
4,154,892 | 4,154,893 |
Action bar/Viewpager?
|
<p>What is the action bar/Viewpager used for and can it be used for navigating through pages?</p>
<p>If it is used for navigating through screens how can i disable swiping through sections in my code so navigation can only be done by clicking on the section buttons within the action bar?</p>
<p><a href="http://pastebin.com/CxMCdf4F" rel="nofollow">My Java code for the action bar</a></p>
|
java android
|
[1, 4]
|
5,764,449 | 5,764,450 |
Share program variable values with Javascript running on browser
|
<p>Well i'm developing a C# windows form application which scan passports in a client PC
in the same client PC user is going to open a webpage with which has some textboxes.</p>
<p>Is there any way to share some values of windows form application with the browser page?</p>
<p>(IS there anyway to invoke some fucntions in Windows App through RPC from the browser Javascript, or any mechanism of share or send these values)
<img src="http://i.stack.imgur.com/JGxnh.png" alt="">.</p>
<p>thanks</p>
|
c# javascript
|
[0, 3]
|
714,115 | 714,116 |
How to send emails from an address without logging into the server
|
<p>I'm building an asp.net application for a client that requires a confirmation email to be sent. I've gotten the code working but the only problem is that I can't get the code to work with their web host (godaddy). Is there a way to send emails with the from address marked as the clients' without having to use godaddy? (essentially faking it) </p>
|
c# asp.net
|
[0, 9]
|
3,333,620 | 3,333,621 |
Jquery with PHP problem
|
<p>Let me post the code first.</p>
<pre><code>function alertCallback<?=$position_info['id']?>()
{
var id = <?=$position_info['id']?>;
var itemname= '<?=$na?>';
<?PHP if($position_info['name'] == $wposition){ ?>
var reward = '<?= $itmname ?>';
$('#selected_item').html(''+itemname+reward);
<?PHP item_add($_SESSION['userid'],$itmid,1); } else { ?>
var noreward = 'You Found Nothing!';
$('#selected_item').html(''+itemname+noreward);
<?PHP } ?>
</code></pre>
<p>}</p>
<p>The above is working to an extent. The page is a image map where if you click on the right spot then you get an item. It is currently working where if you click on the right spot you get the item. Or get told you found nothing.</p>
<p>The problem I have is that the page reloads to set new positions</p>
<pre><code><script type="text/javascript">
//one seconds=1000 micro seconds
setInterval(function() {
$('#load').load('itemclick_ajax.php');
},60000);
</script>
</code></pre>
<p>but another item is won as long as the page is displayed. Any ideas on how to stop this occuring. If i keep the browser showing the page then im running up to thousands of items won.</p>
|
php jquery
|
[2, 5]
|
1,711,051 | 1,711,052 |
Execute an event when everything is clicked except one element?
|
<pre><code>'<div class="lightbox-con">
<div class="lightbox-shade"></div>
<span class="logo"></span>
<div class="controls">
<span class="arrow back"></span><span class="close"></span><span class="arrow forward"></span>
</div>
<div class="caption">
<p class="caption-text"></p>
<span class="logo2" ></span>
</div>
</div>'
</code></pre>
<p>The markup above is a lightbox. Given it's already in an overly state, how do I close/remove it when everything is clicked except the <code>.arrow</code> elements? I tried so many ways and one of them is this:</p>
<pre><code>$(':not(.arrow)').click(function(){
$('.lightbox-con').remove();
});
</code></pre>
<p>The code above won't even allow the lightbox to launch :-\</p>
|
javascript jquery
|
[3, 5]
|
2,054,927 | 2,054,928 |
jQuery reversing prependTo order
|
<p>I have a small problem, I have some static content inside a div and I need to add some extra content to it, prependTo works good, but the new content comes after the exisiting one.
appendTo comes before the exisiting content, but each new appended content comes before the previous append.</p>
<p>Hard to explain, so I added a little example here:
<a href="http://jsfiddle.net/9j958/" rel="nofollow">http://jsfiddle.net/9j958/</a></p>
<p>The foo# order is wrong, as you can see. Any way around this?</p>
|
javascript jquery
|
[3, 5]
|
80,117 | 80,118 |
Getting information from mysql using jquery
|
<p>i have mysql database for i fetch information using json
for example:</p>
<pre><code>$sql ="SELECT * FROM parent WHERE id = '$name'";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$abc=$row[id];
}
echo json_encode($abc)
</code></pre>
<p>Now how can i display this json encoded element in my main html file using jquery?
what i want to do is based on this fetched element i want to do some if else operation.</p>
<p>for example:</p>
<pre><code>if(value of row[id](should be achieved using jquery) ==null)
{}
else
{}
</code></pre>
<p>I am looking for something like $(xxxx).somefunction()
Thanks in advance.</p>
|
php jquery
|
[2, 5]
|
3,550,828 | 3,550,829 |
Stop div scrolling once it reaches another div
|
<p>Basically I currently have a div which stays fixed and follows the user down as they scroll until it reaches a certain point. I can easily make it stop at a fixed pixel position as I have done in the below example, but because I'm a jQuery idiot I have no idea how to make it stop at a div instead. </p>
<p>Here's what I've used so far: </p>
<pre><code>var windw = this;
$.fn.followTo = function ( pos ) {
var $this = this,
$window = $(windw);
$window.scroll(function(e){
if ($window.scrollTop() > pos) {
$this.css({
position: 'absolute',
top: pos
});
} else {
$this.css({
position: 'fixed',
top: 0
});
}
});
};
$('#one').followTo(400);
</code></pre>
<p>Here's the example: <a href="http://jsfiddle.net/Tgm6Y/1445/" rel="nofollow">jsFiddle</a></p>
<p>The reason I want it to stop once it reaches a second div is because with the fluid layout I'm using, the second div will be sitting at different points depending on the browser size. Defining a specific point for it to stop at won't work. Anyone got any ideas as to how I can get this to do what I want? Alternatively, is it possible for the fixed div to stop scrolling once it reaches a percentage of the way down? I've looked around but haven't found anything.</p>
<p>Thanks for any help. </p>
|
javascript jquery
|
[3, 5]
|
5,889,288 | 5,889,289 |
how to validate select through javascript
|
<p>I want to validate select option with javascript like if user select Admin then this page work for admin Login,
Now if user select vendor then for vendor while user for userlogin</p>
<pre><code> <table class="login_table" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="width:30%;">Username</td>
<td style="width:70%;"><input name="uname" id="uname" type="text" /></td>
</tr>
<tr>
<td style="width:30%;">Password</td>
<td style="width:70%;"><input name="upass" id="upass" type="password" /></td>
</tr>
<tr>
<td style="width:30%;">Login Type</td>
<td style="width:70%;">
<select>
<option>Admin</option>
<option>Vendor</option>
<option>User</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:right; padding-right:5px;"><input type="submit" class="login_button" name="login" value="Login" /></td>
</tr>
</table>
</code></pre>
<p>HOw it is Possible </p>
|
php javascript
|
[2, 3]
|
4,212,049 | 4,212,050 |
jQuery - How to make the input values ("email", "password") reappear when out of focus?
|
<p>When I click inside the input fields the values "Email" and "password" disappear which is what I want. But if the user doesn't enter his email/pass and clicks somewhere else, I want "Email" and "Password" to reappear. </p>
<p>jQuery:</p>
<pre><code>$('.login-user, .login-pass').focus(function() {
$(this).val("");
});
</code></pre>
<p>Html:</p>
<pre><code><input type="text" name="user" value="Email" tabindex="1" class="login-user" />
<input type="password" name="password" value="Password" tabindex="2" class="login-pass" />
</code></pre>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
5,149,247 | 5,149,248 |
Looping addEventListener
|
<p>When I console.log(e[i]) in the for loop it gives me a nice print out of all my back buttons, but for some reason when I click on one the event never fires. Thank you in advanced. </p>
<pre><code> function backButtonSubscribe() {
var e = $('.back');
var len = e.length;
for(var i = 0; i < len; i++) {
e[i].addEventListener('click',backButtonEvent,false);
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,734,973 | 2,734,974 |
jQuery .attr('value', 'new_value') not working?
|
<p>I am trying to dynamically change the actual HTML <code>value</code> attribute of an input using jQuery. Although using <code>input.attr('value', 'myNewVal');</code> works to change it visually, when I inspect the source using Developer Tools in Chrome, the HTML attribute hasn't changed.</p>
<p>Since I'm doing a check in some PHP later on to see if the input has its original value, I need a way of changing the actual HTML attribute, ideally in jQuery. Has anyone else encountered this annoying bug and do any of you guys know a workaround?</p>
<p>I've also tried with <code>.val()</code> and the same happens - the underlying HTML attribute is unchanged.</p>
|
javascript jquery
|
[3, 5]
|
293,827 | 293,828 |
calling java classes from python
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3652554/calling-java-from-python">Calling Java from Python</a> </p>
</blockquote>
<p>I am not much familiar with java..
but i want to use a java library (3rd party) inside python.?
Lets say I have three libraries.</p>
<pre><code>foo.java,bar.java,foobar.java
</code></pre>
<p>And then.. they define classes and their contructor takes one variable each</p>
<pre><code>int foo1, int bar1 respectively
Now.. foo.java and bar.java imports foobar.java
</code></pre>
<p>So basically.. i want to interact with foo.java and bar.java.. and then they interact with other java files.. </p>
<p>How do i solve this..
I looked into other stackoverflow questions as well but most of them are like very high level questions for me whereas i feel i have a very simple need.
any pointers
thanks</p>
|
java python
|
[1, 7]
|
2,167,555 | 2,167,556 |
call a javascript method in another .js file
|
<p>what is the rule around calling functions from one js to another ? I thought that this worked but i am not running into issue (figured it out through firefox) that a function in another js file doesn't seem to be recognized in my first js file.</p>
<p>Is there some rule around ordering or some trick you have to do to get this to work?</p>
|
javascript jquery
|
[3, 5]
|
3,916,545 | 3,916,546 |
jquery image gallery showing loader gif
|
<p>I am developing jquery image gallery plugin.
I checked loading of the image like this:</p>
<pre><code>$("#loading").show();
$('.preview').load(function () {
$("#loading").hide();
});
</code></pre>
<p>But I didnt success.
I want to show loading gif when my image is loaded.How can I do this? For ex:
<a href="http://blueimp.github.com/Bootstrap-Image-Gallery/" rel="nofollow">http://blueimp.github.com/Bootstrap-Image-Gallery/</a></p>
|
javascript jquery
|
[3, 5]
|
1,792,274 | 1,792,275 |
ASP.net and PHP costs, requirements and differences
|
<p>What are the requirements for running asp.net and cost compared to PHP? The ASP.net framework is free and I guess Visual Studio for companies cost money and Windows Server; besides that, are there any other costs?</p>
<p>Is asp.net more suitable for bigger projects? ASP.net is object-oriented but is PHP really object-oriented? As far as security goes what's more secure ASP or PHP?</p>
<p>I'm kind of new to web programming, so try to keep the answers simple.</p>
|
php asp.net
|
[2, 9]
|
4,411,238 | 4,411,239 |
Jquery Click to Change Form Field Value
|
<p>I have this code:</p>
<pre><code><input type="text" name="frameSelection" id="frameSelection" value="Option 1" />
<a id="change">Change to Option 2</a>
</code></pre>
<p>When I click on the link I want to change the field value into "Option 2". How can I do that?</p>
|
javascript jquery
|
[3, 5]
|
1,171,482 | 1,171,483 |
Non-Extended Classes in android
|
<p>I have a class Scores.java I need to know whats the correct way to create these. I get "The constructor Scores is not defined. Do I have to extend off everything in Android??</p>
<pre><code>package com.threeuglymen.android.stuff;
import android.app.Application;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;
import android.util.Log;
public class Scores {
private Context mycontext;
public Scores (Context context) {
// TODO Auto-generated method stub
this.mycontext = context;
}
public void resetScores(){
try {
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mycontext);
Editor edit = pref.edit();
edit.putInt("correct", 0);
edit.putInt("incorrect", 0);
edit.commit();
} catch (Exception e) {
Log.d("Scores", "Exception:" + e.toString());
}
return;
}
}
</code></pre>
<p>Thx for any guidance</p>
<p>Eric</p>
|
java android
|
[1, 4]
|
3,245,591 | 3,245,592 |
How to get request url in a jQuery $.get/ajax request
|
<p>I have the code:</p>
<pre><code>$.get('http://www.example.org', {a:1,b:2,c:3}, function(xml) {}, 'xml');
</code></pre>
<p>Is there a way, to fetch the url it used to make the request after the request has been made(in the callback or otherwise)?</p>
<p>I would want the output:</p>
<pre><code>http://www.example.org?a=1&b=2&c=3
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,556,781 | 2,556,782 |
Asp repeater accessing each line from an sql datasource
|
<p>I have a repeater that on itemdatabound i want to access the row in the sqldatasource so i can get the id of an item. </p>
<p>I cant use hidden fields to do this so are there any other options? Thanks to all</p>
|
c# asp.net
|
[0, 9]
|
877,096 | 877,097 |
How to show just a div in iFrame using jQuery?
|
<p>Hi I would like to load a page using iFrame on my website. and as a final result I need to hide everything and show just one div's inner text. How can I accomplish it using jQuery?
or maybe another workaround</p>
|
asp.net jquery
|
[9, 5]
|
130,825 | 130,826 |
How do I create efficient code for a toggle between two buttons in Javascript using jQuery?
|
<p>I'm looking for a way to toggle between two buttons efficiently using javascript and jQuery.</p>
<h1>Scope</h1>
<p>When clicking on either Yes or No, the opposite button will get a <code>disabled</code> CSS class while the clicked button will get an <code>active</code> CSS class. A <code>var</code> will also be saved with a <code>true</code> <code>false</code> value that will be used later.</p>
<h1>html</h1>
<pre><code><div id="buttons">
<button id="yes">Yes</button>
<button id="no">No</button>
</div>
</code></pre>
<h1>js</h1>
<pre><code>function bindButtons(){
var buttons = $('#buttons button');
buttons.on('click', function(e){
var $this = $(this);
buttons.removeClass('selected');
if($this.attr('id') == 'yes'){
var el = $('#no'),
val = true;
$this.removeClass('disabled');
$this.addClass('selected');
el.addClass('disabled');
}
if($this.attr('id') == 'no'){
var el = $('#yes'),
val = false;
$this.removeClass('disabled');
$this.addClass('selected');
el.addClass('disabled');
}
//do something with val
})
}
bindButtons();
</code></pre>
<h1>jsFiddle</h1>
<p><a href="http://jsfiddle.net/RobertSheaO/Tjngw/2/" rel="nofollow">http://jsfiddle.net/RobertSheaO/Tjngw/2/</a></p>
|
javascript jquery
|
[3, 5]
|
3,156,933 | 3,156,934 |
Javascript Multidimensional Array/Hashtable
|
<pre><code>storeChildren : function(coreid, data) {
$.each(data, function(id, type) {
$.core.children[coreid] = {};
$.core.children[coreid]['id'] = id;
$.core.children[coreid]['type'] = type;
});
}
</code></pre>
<p>($.core.children is an object)</p>
<p>I want the resulting array/object (I prefer objects) to look like this (excuse my PHP pseudocode):</p>
<pre><code>array(coreid => array(id=>type, id=>type, id=>type));
</code></pre>
<p>I know I am overwriting $.core.children[coreid] each time I run the loop I just don't know how to fix it.</p>
|
javascript jquery
|
[3, 5]
|
64,095 | 64,096 |
enable/disable functionality buttons based on radio button
|
<p>When the page loads a table with radio buttons is displayed. below the table 3 buttons X, Y, Z are disabled. When the user selects a radio button from the table only then these three buttons X, Y, Z should be enabled?</p>
|
javascript jquery
|
[3, 5]
|
2,290,371 | 2,290,372 |
android browser: issue with child closing via javascript
|
<p>I have a parent page with a button on it (call it "Open"). The Open button opens a child page. In IE the Open button also closes the parent, in other browsers the Open button simply navigates back to the login (since they don't support JS closing a parent window). I am fine with this. The child page has a close button that when clicked closes the child.</p>
<p>However, in android browser if I manually close the parent window after clicking the open button, the child can no longer close itself with it's close button. It is almost as if when the parent dies, the child becomes the parent. Is this what is happening?</p>
|
javascript android
|
[3, 4]
|
5,968,624 | 5,968,625 |
How do I disable or enable 2nd dropdownlist in aspx based on selected choice of the 1st dropdownlist box
|
<p>I am having a problem with disabling DropDownList based on the chice of 1st DropDownList, there is no post back occuring, and it is a template based web app here is the current code:</p>
<pre><code><script type="text/javascript">
$(function() { var dropDownList1 = $('#<%= ddlUserType.ClientID %>');
var dropDownList2 = $('#<%= ddlMember.ClientID %>'); dropDownList1.change(function(e) {
if ( jQuery("#ddlUserType").val() != "ETOC") dropDownList2.removeAttr('disabled'); e.preventDefault();
else
dropDownList2.removeAttr('enabled'); e.preventDefault(); }
} );
</script>
</code></pre>
<p>what is happening now is page is blank and if I remove the above code everything shows, where I am going wrong.</p>
<p>here is the plain and final javascript code which worked:</p>
<pre><code><script language="javascript">
function CheckDropDownState(lstbox)
{
if (lstbox.selectedIndex == 3) { document.forms[0].ddlMember.disabled = 1; }
else { document.forms[0].ddlMember.disabled = 0; }
}
</script>
</code></pre>
<p>and thew .aspx code:</p>
<pre><code><asp:dropdownlist id="ddlUserType" runat="server" onclick="CheckDropDownState(this);"></asp:dropdownlist>
</code></pre>
<p>Once again appreciate the help guys.</p>
|
c# asp.net javascript jquery
|
[0, 9, 3, 5]
|
2,100,294 | 2,100,295 |
onLocationChange() - cant send post request
|
<p>I am creating simple GPS tracker. Application gets gps latitude/longitude and sends it to php on remote server. </p>
<pre><code>@Override
public void onLocationChanged(Location loc)
{
String infLat = Double.toString(loc.getLatitude());
String infLon = Double.toString(loc.getLongitude());
String Text = "My current location is: " +
"Latitud = " + infLat +
"Longitud = " + infLon;
Toast.makeText( getApplicationContext(),
Text,
Toast.LENGTH_SHORT).show();
uploadLoc(infLat, infLon); // calling method which sends location info
}
</code></pre>
<p>And here is uploadLoc:</p>
<pre><code>public void uploadLoc(String a, String b) {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://link to script");
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("latitude", a));
nameValuePairs.add(new BasicNameValuePair("longitude", b));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
} catch (ClientProtocolException e) {
//
} catch (IOException e) {
//
}
}
</code></pre>
<p>But i am constantly getting "application has stopped". When i remove line that is calling uploadLoc method, everything works and Toast is updated as location changes. What can be wrong here? </p>
|
java android
|
[1, 4]
|
2,909,829 | 2,909,830 |
List<> remove item problem
|
<p>We are using <code>List<object></code> type as datasource for dropdownlist. </p>
<p>Process flow:</p>
<ol>
<li>Assign value (<code>List<object></code>) to the session in the pageload event(<code>!ispostback</code>).</li>
<li>Reterive value from session in <code>ddl_SelectedIndexChanged</code> event </li>
<li>Remove a particular item from the list and bind to the ddl</li>
</ol>
<p>Code:</p>
<pre><code>List<Loc> locList = new List<Loc>();
locList = (List<Loc>)Session["Loc"];
locID = "xxx";
locList.RemoveAt(locList.FindIndex(FindLocation));
</code></pre>
<p>Problem:</p>
<p>Item getting removed from the base source also (session).</p>
|
c# asp.net
|
[0, 9]
|
3,138,158 | 3,138,159 |
Getting dynamically created tags (jQuery) from ASP.NET
|
<p>I have web page in ASP.NET. I have created Tree View control with jQuery. I drag items from the tree and drop into the div element. </p>
<pre><code><div id="rows" runat="server" class="droppable">
</div>
</code></pre>
<p>I add items to that div using .append function from jQuery. </p>
<pre><code>$(".droppable").append(event.originalTarget.innerHTML);
</code></pre>
<p>It works like I want. But now I want to get all dropped items from ASP.NET code. I use following code:</p>
<pre><code>protected void Button2_Click(object sender, EventArgs e)
{
HtmlGenericControl control = (HtmlGenericControl)Page.FindControl("rows");
Label1.Text = control.InnerHtml;
}
</code></pre>
<p>But it doesn't work. I've also tried InnerText function, but still nothing. I've also put the button and label controls into UpdatePanel so the page doesn't refresh and my dropped item are still in div element.</p>
<p>How can I get dynamically added items from ASP.NET code.</p>
<p>Lukas</p>
|
asp.net jquery
|
[9, 5]
|
1,434,611 | 1,434,612 |
Check for multiple hash substrings
|
<p>I'm trying to check for two different hash substrings and execute different code depending. This is what I have right now:</p>
<p><strong>Javascript</strong></p>
<pre><code>if(window.location.hash.substring(confirm) {
$('.confirm').click();
}
elseif(window.location.hash.substring(thanks) {
$('.thanks').click();
}
</code></pre>
<p>Any idea what I am doing wrong?</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.