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 |
|---|---|---|---|---|---|
1,031,767
| 1,031,768
|
Stop jquery from calling function when a slider is opened a second time
|
<p>I have a simple jquery set up to open a sliding panel, and then initiate a second function to start a slide show within that panel. When I close the panel and open it a second time, it calls the function a second time as well, thus giving me duplicate sliders.</p>
<pre><code> $(function() {
$('a.everyday').click(function() {
$('#everyday').addClass('open').stop().animate({top:'30px'},{queue:false,duration:400});
// Activates Blinds jquery image slider
$(function() {
$('.slideshow').blinds();
});
});
});
</code></pre>
<p>So the second time the .click function occurs, I'd like jquery to not initiate the .blinds function.</p>
|
javascript jquery
|
[3, 5]
|
4,086,814
| 4,086,815
|
Javascript error: Missing : after property id?
|
<p>Here's the code:</p>
<pre><code>window.onload({
var Country = '<?= $core->HotelData($hid, "country"); ?>';
var options = document.getElementsByTagName('option');
for (var i = 0; i < inputs.length; i ++) {
if (options[i].type == 'option' && options[i].value == Country) {
options[i].attr('selected','selected');
}
}
});
</code></pre>
<p>I've been struggling with this for hours now, and figured it'd be better if I sought advice from experts.</p>
<p>UPDATE: Source</p>
<pre><code>window.onload({
var Country = 'United Kingdom';
var options = document.getElementsByTagName('option');
for (var i = 0; i < inputs.length; i ++) {
if (options[i].type == 'option' && options[i].value == Country) {
options[i].attr('selected','selected');
}
}
});
</code></pre>
<p>UPDATE#2: Fix
The cause of the problem was mostly my stupidity.. ktnxbai</p>
<pre><code>function OnLoad() {
var Country = "<?= $core->HotelData($hid, "country"); ?>";
var options = document.getElementsByTagName('option');
for (var i = 0; i < options.length; i ++) {
if (options[i].value == Country) {
options[i].selected = true;
}
}
}
window.onload = OnLoad();
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,920,214
| 2,920,215
|
Popup on mouse hover the word
|
<p>I am doing a website using asp.net C# and I would like to popup a small window with information as soon as mouse hover a particular word. I know that I have to use jquery but I don't know exactly how to do it.</p>
<p>Any suggestions please?</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
5,401,076
| 5,401,077
|
How to Load an object to a jQuery object
|
<p>In my javascript, I have a function which will return an element present in the HTML page .i have this stored in a variable and now want to do some kind of traversal in that using jquery methods like parent/fadeIn/fadeOut etc.</p>
<p>How can i do that.? My current code which returns the object is </p>
<pre><code> var currentObject= GetThatObject();
</code></pre>
<p>Now i really want to play with this object like what we do with a typical jQuery object which we get like</p>
<pre><code> var curObj=$("#tatElement")
</code></pre>
|
javascript jquery
|
[3, 5]
|
433,496
| 433,497
|
Windows Authentication and memberships and roles provider
|
<p>I have been in the dark about the windows auth. for quite sometime now and was wondering if you brilliant people could help me out. I need to use windows authentication but still harness the power of the memberships provider. what i am doing is creating a user with the membership provider based on my windows username. the problem is i have authentication="forms" (Which this works locally). What i am trying to do now is when i change it to authenication ="windows" - i cannot get the request.servervariables["LOGON_USER"] name to appear. it is always blank. Could someoen please help in regards to this matter.
Thanks in advance.</p>
|
c# asp.net
|
[0, 9]
|
5,468,340
| 5,468,341
|
how to make a link click show content of div using z-index?
|
<p>How to make a anchor link click should show the content of a div but without pushing the content underneath the link down.And when you click out side of that div should close the div.</p>
<p>Javascript or jquery is fine. Here is what I got so far:</p>
<pre><code><a onclick="toggleDiv()"></a>
<div id="translate" style="display:none;">This is the content should be shown but don't push the content down.</div>
</code></pre>
<p>Here is the script</p>
<pre><code>function toggleDiv()
{
var googleDiv = document.getElementById('translate');
if(googleDiv.style.display == 'block')
googleDiv.style.display = 'none';
else
googleDiv.style.display = 'block';
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
244,425
| 244,426
|
What is the equivalent to SoapExtension for JSON WebMethods?
|
<p>I've a few web methods that I use to call some external services like the Google Calendar API, obviously these can be extremely brittle.</p>
<p>Unfortunately I now realise that any error thrown on these methods are not causing an exception to bubble up to Global.asax which is where errors are getting logged in this application.</p>
<p>I have seen suggestions to wrap the method in a try/catch, which is a stupid way of doing it as there are a variety of errors that ASP.Net will silently swallow still.</p>
<p>In trying to find a solution I've seen a lot of references to <code>SoapExtension</code>, which is exactly what I want to do but doesn't get fired as I'm returning Json. What I really want is a way to catch the error just like that.</p>
<p>Any pointers appreciated, I still can't understand how the ASP.Net team could have thought that silently swallowing errors like this was a bright idea.</p>
<p>So for example a method like this:</p>
<pre><code> [WebMethod]
[ExceptionHandling] //can I write a handler like this to catch exceptions from JSON webservices?
static public void DeleteItem(string id)
{
var api = new GoogleCalendarAPI(User.InternalUser());
api.DeleteEvent(id);
return "success";
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,329,765
| 4,329,766
|
HashMap gives an unordered list of values?
|
<p>I'm having a weird problem with HashMap in Android. I'm putting values into the hashmap which is of the form</p>
<pre><code>HashMap <String,String> sample = new HashMap<String,String>();
</code></pre>
<p>However let's say I'm putting the following values in the following order:</p>
<pre><code>sample.put("ifi1", "video1");
sample.put("ifi2", "video2");
sample.put("ifi3", "video3");
sample.put("ifi4", "video4");
sample.put("ifi5", "video5");
sample.put("ifi6", "video6");
sample.put("ifi7", "video7");
sample.put("ifi8", "video8");
sample.put("ifi9", "video9");
</code></pre>
<p>This is just a simple example that is similar to what i have. I only have a bigger list in my actual code. However when I now try to print only the values, I get an unordered list as follows:</p>
<pre><code>VIDEOS: video1
VIDEOS: video3
VIDEOS: video2
VIDEOS: video5
VIDEOS: video4
VIDEOS: video7
VIDEOS: video6
VIDEOS: video9
VIDEOS: video8
</code></pre>
<p>where in fact I'm expecting it to produces the following list:</p>
<pre><code>VIDEOS: video1
VIDEOS: video2
VIDEOS: video3
VIDEOS: video4
VIDEOS: video5
VIDEOS: video6
VIDEOS: video7
VIDEOS: video8
VIDEOS: video9
</code></pre>
<p>Why is this, any idea?</p>
|
java android
|
[1, 4]
|
4,208,193
| 4,208,194
|
GPS Location Accuracy Issue
|
<p>I'm working on an Android app that uses high-resolution GPS data. It's designed to be used in a car, so I'm not too worried about battery life. I've noticed that when I run my app while the stock Google navigation app is running, my GPS data has accuracy within several (< 10) meters. </p>
<p>However, when I run my app without the navigation app, my location data starts off precise, but soon becomes poor (within 1000 m). I have my app in a <code>PARTIAL_WAKE_LOCK</code> so the CPU keeps running, but the screen can shut off.</p>
<p>Here's how I'm requesting GPS location: </p>
<p><code>requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, GPSListener);</code> </p>
<p>Does anyone know of a way to request data more precisely? The <a href="http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates%28java.lang.String,%20long,%20float,%20android.app.PendingIntent%29" rel="nofollow">Android Docs</a> claim this means there is no lower limit on the time or distance between separate GPS calls. But clearly the stock navigation app is doing something differently. Does anyone have any ideas? Thanks in advance.</p>
|
java android
|
[1, 4]
|
4,191,811
| 4,191,812
|
create buttons dynamically to call method and pass in parameter
|
<p>I have a dictionary with a key value pair and need to loop through the pairs and create a button for each one and wire up the button to call a method DisplayDocument(string Id) and pass in the Key as a parameter.</p>
<p>Here's what I have so far.</p>
<pre><code> // test data
var documents= new Dictionary<string,string>();
documents.Add("69110","Diploma");
documents.Add("76404", "Licensure");
foreach (KeyValuePair<string, string> item in documents)
{
MyStringBuilder=MyStringBuilder.Append(item.Value + " " + item.Key + "<br />");
}
printFaxDocuments.InnerHtml = MyStringBuilder.ToString();
</code></pre>
<p>What i want to do is print out the document Key and Value and then a button that the use can click to view the document. I have the method built to view the document and it requires the Key value to be passed in. How can I do this?</p>
<p>I'm not sure how to intersperse the button in the text data. I need to write out the key and value add the button add a <code>"<br/>"</code> and then do the same thing again for the next item in the dictionary.</p>
|
c# asp.net
|
[0, 9]
|
2,053,078
| 2,053,079
|
I use asp.net fileupload control to upload files but it is work on localhost not work on remote server
|
<p>I use asp.net fileupload control to upload files but it is work on localhost not work on remote server i use this line of code to do this but it is not work when i publish the page to server </p>
<pre><code>FileUpload1.PostedFile.SaveAs(Server.MapPath("products_images/")
+ FileUpload1.PostedFile.FileName);
</code></pre>
<p>please help me </p>
|
c# asp.net
|
[0, 9]
|
2,611,587
| 2,611,588
|
c# update current time,days,date
|
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
todayDate.Text=DateTime.Now.toString();
}
</code></pre>
<p>Output</p>
<blockquote>
<p>10:28AM 9/28/2011</p>
</blockquote>
<p>the current time is never update, the result is static, how do i set a interval in c# in order to update current time?</p>
<p>updated information</p>
<p>this is my ajax updated timer code</p>
<pre><code> <ajax:ToolkitScriptManager ID="scriptmanager1" runat="server">
</code></pre>
<p>
</p>
<pre><code> <asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
</Triggers>
<ContentTemplate>
<asp:Label runat="server" id="DateStampLabel" />
</code></pre>
<p>and i called it by using</p>
<pre><code>protected void UpdateTimer_Tick(object sender, EventArgs e)
{
DateStampLabel.Text = DateTime.Now.ToString() + " "+DateTime.Today.DayOfWeek.ToString();
}
</code></pre>
<p>output is exactly what i want, but the effect not exactly what i want, cause when user clicked on some button,the label will blink, this like telling the user the page is reloading, so i wondering is that any idea can deliver update time from server? or just refresh partial pages?</p>
|
c# asp.net
|
[0, 9]
|
642,230
| 642,231
|
Access Layout Elements to the Depth of N
|
<p>I have a pretty annoying problem here, as Im still trying to internalize each and every bits of what I am doing,</p>
<p>I currently have a LinearLayout, then upon onCreate of the Activity, I will populate or inflate several other LinearLayout's with Buttons, my problem is that when I try to access the button, it seems that I'm not getting any close or deeper from the LinearLayout, all I can get is the LinearLayout(Parent) and the other LinearLayout(Children), I believe there is a way, Im just totally confused how to do it.</p>
<pre><code>LinearLayout
->LinearLayout(Child1)->Button1, Button2, Button3
->LinearLayout(Child2)->Button4, Button5, Button6
</code></pre>
<p>How would I be able to access and get the Buttons?</p>
<p>My source;</p>
<pre><code>for (int x=0; x<ll.getChildCount(); x++){
View v = ll.getChildAt(x);
Class c = v.getClass();
if(c == LinearLayout.class){
for(int y=0; y< ; y++){
**I know there is something that must be done here, likewise, is this the most
efficient way of doing things?
}
}
Log.i("test", c.getName());
}
</code></pre>
<p>Only the LinearLayout(Parent) exist in the XML, others are inflated run-time.</p>
|
java php android
|
[1, 2, 4]
|
5,577,212
| 5,577,213
|
JavaScript: get and set variables in window.location.hash?
|
<p>Does anyone have a good solution for getting and setting variables in <code>window.location.hash</code>?</p>
<p>Take a URL that looks like this:</p>
<pre><code>domain.com/#q=1&s=2
</code></pre>
<p>What I'd like is an unstressful way - JavaScript or jQuery - to check the values of <code>q</code> and <code>s</code> when the page loads, and change them following events on the page.</p>
<p>I have found <a href="http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html" rel="nofollow">some code for getting hash variables</a>, but nothing sensible for setting them. </p>
<p>Am I missing something really obvious, or do I need to roll my own solution (and release it!)?</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
4,570,134
| 4,570,135
|
JQuery. How to load inputs values to an array?
|
<p>I have multiple input fields.</p>
<pre><code><input type='text' size='10' name='firstname' id='firstname' />
<input type='text' size='20' name='lastname' id='lastname' />
<input type='password' size='5' name='password' id='password' />
</code></pre>
<p>I want to get all their values into a single array with jQuery. Like this one.</p>
<pre><code>1 => 'Barack',
2 => 'Obama',
3 => '123456'
</code></pre>
<p>Existing method val() returns value from first match.</p>
<pre><code>$('#firstname,#lastname,#password').val(); //returns only first name
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,053,044
| 2,053,045
|
Uploading an Excel sheet with a specified sheet name using oledb
|
<p>How to upload an excel sheet using asp.net and know the structure of the columns in the sheet so that it would be helpful in using sqlbulkcopy to upload to a table with similar structure.</p>
<p>any answers would be appreciated.</p>
<p>Thanks in advance.</p>
|
c# asp.net
|
[0, 9]
|
637,601
| 637,602
|
Using jQuery with google.load
|
<p>I am trying to understand how to use jQuery when it is loaded using Google CDN's google.load method.</p>
<p>Putting the init code in the setOnLoadCallback function works great but defining functions for event handlers in the markup doesn't seem to work. In the example below, the P button works as expected but the Div button does nothing.</p>
<p>Yes, in this example, I can put the div's onclick handler also in the setOnLoadCallback function but does that mean that <strong>all</strong> jQuery code has to be there? </p>
<p>Help? Thanks</p>
<pre><code><p id="p">Content</p><button type="button" id="btn1">P</button>
<div id="div">Div</div><button type="button" id="btn2" onclick="btn2()">Div</button>
<script src="http://www.google.com/jsapi"></script>
<script>
function btn2() {
$("#div").toggle("slow");
}
google.load("jquery", "1.3.2");
google.setOnLoadCallback(function() {
$("#btn1").click(function () {
$("p").toggle("slow");
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,932,409
| 1,932,410
|
Select Item in Asp.Net?
|
<p>good morning. </p>
<p>i am trying to do a list of selecting items in asp.net. </p>
<p>the purpose of it , is a page of "Contact Us" . </p>
<p>so i did a textboxes, a buttom. </p>
<p>but, i need thay to select item from a list, any one have any idea? </p>
<p>thanks all !</p>
|
c# asp.net
|
[0, 9]
|
2,993,679
| 2,993,680
|
jQuery width() not returning correct value on a div with generated content
|
<p>With the code below, the alert doesn't return the actual size of #main, it always returns the value of #main's css width with the % dropped. So in this case I get 95 in the alert. If I alert parent().width() I get 100. </p>
<p>The data returned from the .get() call is a ul that sometimes is wider than #main, and sometimes not. The width of the content doesn't seem to have any bearing on what .width() returns.</p>
<p>So my question is, how do I get the true pixel width of #main?</p>
<p>CSS:</p>
<pre><code>#container {
width: 100%;
}
#main {
width: 95%;
overflow: hidden;
}
</code></pre>
<p>HTML:</p>
<pre><code><div id="conatiner">
<div id="main"></div>
</div>
</code></pre>
<p>Javascript/jQuery:</p>
<pre><code>$.get('page.php', function(result) {
$('#main').html(result);
});
alert($('#main').width();
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,697,538
| 3,697,539
|
How to get selected index of a Html select in asp.net?
|
<p>I have code below:</p>
<pre><code> <select id="test">
<option value="a">aaa</option>
<option value="b">bbb</option>
</select>
<asp:Button ID="btnTest" runat="server" Text="Test it!" onclick="btnTest_Click" />
I need to get selected index not selected value on postback. How can I do this with asp.net?
this is my code for filling the select html:
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#<%=btnTest.ClientID %>").click(function(){
$.ajax(
{ url: "StateCity.asmx/ReferItems?id=" + getParameterByName('id'),
contentType: "application/json; charset=utf-8",
dataType: "json",
type: "POST",
success: function(data) {
$("#test").empty();
$.each(data.d, function() {
$("#test").append($("<option></option>").val(this['Value']).html(this['Text']));
});
},
error: function() { alert("Error"); }
})
})
</script>
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,125,885
| 2,125,886
|
Javascript link with onClick event
|
<p>I am using a third-party shopping cart from <a href="http://simplecartjs.com/" rel="nofollow">http://simplecartjs.com/</a> .
For a normal checkout I can use:</p>
<pre><code><a href="javascript:;" class="simpleCart_checkout" >Checkout</a>
</code></pre>
<p>And it works. But I need to add some server-side functionality and don't know how to go about this. The code inside the javascript file where the simpleCart_Checkout class is stored is as follows:</p>
<pre><code>me.addEventToArray( getElementsByClassName('simpleCart_checkout') , simpleCart.checkout , "click");
</code></pre>
<p>EDIT: and this:</p>
<pre><code>me.checkout = function() {
if( me.quantity === 0 ){
error("Cart is empty");
return;
}
switch( me.checkoutTo ){
case PayPal:
me.paypalCheckout();
break;
case GoogleCheckout:
me.googleCheckout();
break;
case Email:
me.emailCheckout();
break;
default:
me.customCheckout();
break;
}
};
</code></pre>
<p>So I tried doing it using a button calling the method directly:</p>
<pre><code><asp:Button ID="CheckoutButton" runat="server" Text="Checkout"
onclick="CheckoutButton_Click" OnClientClick="Checkout()" />
<script type="text/javascript">
function Checkout() {
javascript: simpleCart.checkout;
}
</script>
</code></pre>
<p>Which calls the server-side but doesn't call the javascript link. I am new to asp.net and javascript so don't really know any other ways of how I can do this, please help.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,257,766
| 4,257,767
|
Any Idea for Showing Latest News in a Website
|
<p>What is the best way for presenting latest news in the website?</p>
<p>Is there any template such as JQuery or Javascript for that?</p>
|
javascript jquery
|
[3, 5]
|
2,942,949
| 2,942,950
|
Auto Click a button on a web page
|
<p>I need to auto click a button on a web page.
Basically i have a user interface to see the logs of the network printer. This page already has a option 'Save in CSV Format'.When i click this, i get a popup box which asks if you want to run or save that file. </p>
<p>The issue is:
I am creating another web page where i want that if a user clicks on 'Clickme' button, he automatically gets that popup box, which appears when i click on the 'Save in CSV Format' in that User Interface. Using HTTPFOX, i found out that 'Save in CSV Format' has this detail:</p>
<pre><code><td bgcolor="#333333" height="27" align="right"><input type="button" value="Save in CSV Format... " onClick="get_loglist()"></td>
</code></pre>
<p>Is there any way i can do this? Thanks in advance. </p>
|
php javascript
|
[2, 3]
|
829,215
| 829,216
|
c# failed to check existed file in directory
|
<p>there are nothing is inside my test002 folder, by right my output should be is "nothing is inside the folder",but after compile there are nothing prompt.</p>
<p>what i want to do is if there are any .doc file is inside my folder, just upload it
if there are nothing is inside the folder, ask user to upload .doc to required folder.</p>
<pre><code>protected void Button3_Click(object sender, EventArgs e)
{
try
{
string[] chkUserResume = Directory.GetFiles(HttpContext.Current.Server.MapPath(@"~/Enduser/test002/"), "*.doc");
if (chkUserResume!=null)
{
foreach (string name in chkUserResume)
{
Response.Write(name + " is exist");
}
}
else
{
Response.Write("nothing is inside the folder");
}
}
catch (Exception ex)
{
Response.Write(ex.Message.ToString());
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,763,358
| 5,763,359
|
time picker in php
|
<p>please help me out regarding time in php. I want to make time selection for a website that offers their services at different time . I want to make it like a date picker calendar . I haven't find anything yet . i can make in drop down box but showing the 60 min drop down looks quite ugly . plz help me out regarding this .</p>
|
php javascript
|
[2, 3]
|
1,925,618
| 1,925,619
|
Change ListView with Autocompletion
|
<p>Basically what I want is a ListView with a TextBox on top. Currently I fetch all my contacts in a list. But e.g. if I type 'a' in the textbox, I only want to see all contacts starting with an a. Same if you type in 'an' I only want to see the contacts beginning with an.</p>
<p>Currently I have my Listview with my contacts, but even after googling around, I still found no solution for my problem.</p>
<p>Kind Regards,</p>
<p>Punxdelirium</p>
|
java android
|
[1, 4]
|
1,217,619
| 1,217,620
|
jQuery won't let me do if blocks?
|
<p>I am trying to do a fade effect, that fades out a div and substitutes it for another. For that I have created a lastDiv var which sets the number of the last div clicked. </p>
<p>But when I try to set an if js says there is an error. I am pretty sure that I am using the correct syntax. (I am a beginner) </p>
<p>Thanks </p>
<p></p>
<pre><code>var lastDiv = 1;
$("#item1").click(function () {
if(lastDiv == 2) { $("#div2").fadeOut(0500, function() { $("#div1").fadeIn(500, function () {lastDiv = 1;}); }); }); }
else if (lastDiv == 3) { $("#div3").fadeOut(0500, function() { $("#div1").fadeIn(500, function () {lastDiv = 1;}); }); }); }
$("#item2").click(function () {
if(lastDiv == 1){ $("#div1").fadeOut(0500, function() { $("#div2").fadeIn(0500, function () {lastDiv = 2;}) }); }); }
else if(lastDiv == 3){ $("#div3").fadeOut(0500, function() { $("#div2").fadeIn(0500, function () {lastDiv = 2;}) }); }); }
$("#item3").click(function () {
if(lastDiv == 1) { $("#div1").fadeOut(0500, function() { $("#div3").fadeIn(0500, function () { lastDiv = 3 }) }); }
else if(lastDiv == 2) { $("#div2").fadeOut(0500, function() { $("#div3").fadeIn(0500, function () { lastDiv = 3 }) }); } });
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,144,016
| 3,144,017
|
how to fire both client side and server side validations at once?
|
<p>I have a textbox and I do CustomValidation which does client side and server side validations,
how do I fire both client side and server side validations at once? now server side validation fires only after client side validation.</p>
<p>is it possible?</p>
|
c# asp.net
|
[0, 9]
|
5,263,462
| 5,263,463
|
Deleting any element, the reassigning the count value
|
<p>Sorry about the cryptic title, it's hard to describe!</p>
<p>I am using the following script to add a row to my form when a button is clicked:</p>
<pre><code> $(document).ready(function() {
$('#btnAdd').click(function() {
var num = $('.clonedInput').length;
var newNum = new Number(num + 1);
var newElem = $('#input' + num).clone().attr('id', 'input' + newNum);
newElem.children(':first').attr('id', 'name' + newNum).attr('name', 'name' + newNum);
$('#input' + num).after(newElem);
$('#btnDel').attr('disabled','');
if (newNum == 5)
$('#btnAdd').attr('disabled','disabled');
});
$('#btnDel').click(function() {
var num = $('.clonedInput').length;
$('#input' + num).remove();
$('#btnAdd').attr('disabled','');
if (num-1 == 1)
$('#btnDel').attr('disabled','disabled');
});
$('#btnDel').attr('disabled','disabled');
});
</code></pre>
<p>This works absolutely fine, but it's not very user-friendly that you can only delete the last added row. Say I want to delete a row added earlier on, I would have to delete everything I'd done since then.</p>
<p>How can I delete any row, and at the same time reassign the count value to the other rows, so that the count is still sequential (i.e. Row1, Row2, Row3 etc, rather than Row1, Row5, Row8)?</p>
|
javascript jquery
|
[3, 5]
|
5,225,863
| 5,225,864
|
When loading a C++ dll in C#, does the CLR load the dependencies of the C++ file automatically?
|
<p>Well that is my question, I am planning to implement a C++ dll which has many C++ dependencies, and I want to use it in my c# code..What I wanted to know is if the CLR loads the dependencies on its own or will I have to do something else.
When loading a C++ dll in C#, does the CLR load the dependencies of the C++ file automatically?</p>
|
c# c++
|
[0, 6]
|
2,900,052
| 2,900,053
|
How invoke live method with arguments
|
<p>I am learning how to write jQuery plugin. So why I am doing what I am doing does not matter.</p>
<p>I writing a plugin called live2 which does nothing else but internally calls live method.</p>
<pre><code>(function($) {
$.fn.live2 = function() {
/* if there are no elements then just return */
if (!this.length) return this;
return this.each(function() {
var $this = $(this);
jQuery.fn.live.apply(this, arguments);
}); // end of return this.each(function())
}; // end of plugin
})(jQuery);
</code></pre>
<p>Above code should be invoked just live any live method. Instead of live use live2.</p>
<pre><code>$('#container').live2('click',function(){
return false;
})
</code></pre>
<p>But the plugin is not working. Any idea what the fix should be.</p>
|
javascript jquery
|
[3, 5]
|
4,898,174
| 4,898,175
|
What are the advantages to putting your Javascript in a .php file?
|
<p>I occasionally come across pages where some Javascript is included via a PHP file:</p>
<pre><code><html>
<head>
<script type="text/javascript" src="fake_js.php"></script>
</head>
<body onload="handleLoad();">
</body>
</html>
</code></pre>
<p>where the contents of <strong>fake_js.php</strong> might look something like this:</p>
<pre><code><?php header('Content-type: text/javascript') ?>
function handleLoad() {
alert('I loaded');
}
</code></pre>
<p>What are the advantages (or disadvantages) to including Javascript like this?</p>
|
php javascript
|
[2, 3]
|
60,028
| 60,029
|
Looking for C# - Java feature equivalence cheat sheet
|
<p>I'm looking for a resource that should help C# developer learning Java. I would like to have a fast reference that says, for instance:</p>
<pre><code>C# | Java | Suggested alternative
Extension Method | NA | ...
Attributes | Annotations | ...
</code></pre>
<p>such a cheat sheet would be great resource in order to me, because he would help to break a thin barrier between the two world.</p>
|
c# java
|
[0, 1]
|
5,096,328
| 5,096,329
|
The false element in a Logical operation
|
<p>I wish to know if there's some way to know which is the elemnet of a logic operation is false?<br>
Example. </p>
<pre><code>if( String.IsNullOrEmpty(obj1) || (String.IsNullOrEmpty(obj2) )
throw("...............");
</code></pre>
<p>How can I kown which one of those is the empty one? </p>
|
java c#
|
[1, 0]
|
2,828,763
| 2,828,764
|
pass variable from page load to button click event
|
<p>i am creating a page that when page load it will connect to the database to check the user status to determine which part can be shown, then user can click submit button which need to connect to the database again to update some information. </p>
<p>So is there a efficient way to do this? now I have to connect to the database twice or is there a method to pass variables from page load event to button click event. </p>
<p>Any idea? thanks </p>
|
c# asp.net
|
[0, 9]
|
4,376,706
| 4,376,707
|
Creating a spray effect on touch draw in android
|
<p>My application requires me to create spray like effect when user touches the screen. The user had the option of choosing a color. I need to create a spray like effect with the color user chooses. I am not sure if its possible or not. If it possible please suggest me a link or a guide to go through.</p>
|
java android
|
[1, 4]
|
164,028
| 164,029
|
How to pause an event in jQuery?
|
<p>I have a question regarding events.</p>
<p>Basically, I want to run a jquery method when the user clicks a link to leave the page. In this method I want to check a few things before they leave, so I know I can call:</p>
<pre><code>e.preventDefault();
</code></pre>
<p>But what if I want the event to continue after I prevent the event?</p>
<p>Any suggestions how to approach this?</p>
<p>Thank you!</p>
|
javascript jquery
|
[3, 5]
|
3,953,168
| 3,953,169
|
DataGrid and formatting data
|
<p>I'm new to ASP.NET and don't really understand how to display a table with database data. The data is loaded in an object, where I have a list of objects.</p>
<p>Now I want to show a table with some columns, an image (path created from two fields in the object), an link (passing one field of the object), a textarea (id from object, value from object), a radiobutton (id from object).</p>
<p>How should I do this. I have tried binding a datagrid to the list of objects, and it works. But I don't want to show all data members, and I don't know how to create correct headers and the image and form controls.</p>
<pre><code> ImageDataGridView.DataSource = tradeObj.Images;
ImageDataGridView.DataBind();
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,338,082
| 4,338,083
|
How to ESCAPE "comma" in Javascript
|
<p><strong>EDIT1:</strong></p>
<pre><code>btnDelete.Attributes.Add("onclick", String.Format(@"return DeleteRow('{0}',{1},{2},{3});", e.Row.ClientID, e.Row.RowIndex, DataBinder.Eval(e.Row.DataItem, "Id"), "'" + DataBinder.Eval(e.Row.DataItem, "Name") + "'"));
</code></pre>
<p>edit:</p>
<p>i get this error:</p>
<p><strong>Message: Unterminated string constant</strong></p>
<p>i am passing the value from code behind and some of my text have somethinh lke this:</p>
<p><strong><code>Foo3, In.c</code></strong> </p>
<pre><code> //javascript
function DeleteRow(rowId, rowIdx, Id, Name) {
var textForMessage = "return confirm('Are you sure you want to delete this record with the name: \n{0} \n{1}');";
//removed code...
return result;
}
</code></pre>
|
javascript asp.net
|
[3, 9]
|
1,861,624
| 1,861,625
|
Javascript/jQuery encoding for special characters when using val()
|
<p>I have a problem with special characters like &, ä, etc. and their corresponding HTML encoded writing like <code>&amp;</code>, <code>&auml;</code> etc.</p>
<ul>
<li><p>When they are used in the value tag of input fields, the browser decodes it automatically, no problem at all.</p></li>
<li><p>When using jQuerys val() function, the browser has no chance to evaluate the content correctly</p>
<pre><code>$("button").click(function(){
$("#test").val("&amp;");
});
</code></pre></li>
</ul>
<p>Any idea?</p>
|
javascript jquery
|
[3, 5]
|
914,338
| 914,339
|
How to open a popup and send a JSON object to it
|
<p>I want to send a <a href="http://en.wikipedia.org/wiki/JSON" rel="nofollow">JSON</a> object to a <a href="http://en.wikipedia.org/wiki/PHP" rel="nofollow">PHP</a> file while my script opens that PHP file in a new <strong>popup</strong> window. Is it possible to send it via POST method (by jQuery or without it)? </p>
<p>If not, how do I convert JSON to a <a href="http://en.wikipedia.org/wiki/Percent-encoding" rel="nofollow">URL encoded</a> string? Is there any JavaScript function?</p>
|
javascript jquery
|
[3, 5]
|
1,846,981
| 1,846,982
|
problems with $().click() when generating JavaScript code with a PHP loop
|
<p>Regards.
I am generating an .click event for every element of my table using a php loop like this:</p>
<pre><code><?php foreach ($elements as $element){ ?>
var element_id = <?= json_encode($element['element_id']));?>;
$('#'+element_id+'_button').click(function() {
$('#'+element_id+'_interval').toggle();
if ($(this).hasClass('active')){
$(this).removeClass('active');
}
else{
$(this).addClass('active');
}
});
<?php }?>
</code></pre>
<p>the problem is, when <code>$('#'+element_id+'_interval').toggle();</code> the element is not responding but it adds and removes the classes correctly, somebody help me please.</p>
|
php javascript
|
[2, 3]
|
3,620,337
| 3,620,338
|
Blur event stops click event
|
<p>Example code: <a href="http://jsfiddle.net/slolife/PnmxM/" rel="nofollow">http://jsfiddle.net/slolife/PnmxM/</a></p>
<p>I am asking this even though there are a number of similar questions, but I feel that they are not the same.</p>
<p>I have an textbox that when it is blurred, should do something.</p>
<p>I also have a link, that is always visible (that appears to be how the other questions differ) and when clicked, should do something.</p>
<p>My blur handler fires, but the click handler does not.</p>
<p>Is there a proper way to deal with this?</p>
<p><strong>Update</strong></p>
<p>Many people pointed out that the alerts were causing my problem. Thank you. In my real code, I do not have alerts, but instead remove the textbox from the DOM.</p>
<p>So I have updated the fiddle to better reflect that with console.log calls instead of alert() calls. Any additional help is appreciated.</p>
|
javascript jquery
|
[3, 5]
|
2,206,210
| 2,206,211
|
Repeat line x to y every few second in php
|
<p>how i can repeat code from line x to y in php By Ajax.</p>
<p>for example:</p>
<p>mycode:</p>
<pre><code>$info_2=('<div id="infobox">');
echo $chat_2;
$info_query=mysql_query("SELECT * FROM info WHERE fuid='$uid' or luid='$uid' ");
$info_num=mysql_num_rows($info_query);
for($i=0;$i<$info_num;$i++)
{
$info_fetch=mysql_fetch_array($info_query);
echo($info_fetch['username'].':'.$info_fetch['text'].'<br>');
}
</code></pre>
<p>$info_3=('');
echo $info_3;</p>
<p>now i need repeat this code every x second.</p>
|
php javascript
|
[2, 3]
|
2,032,049
| 2,032,050
|
JQuery get Value of an Element: onfocus="inputInlineHint(self);"
|
<p>i have an input field which calls the function "inputInlineHint(self)" on blur and on focus.
It also passes self...</p>
<pre><code><input type="text" id="one" class="textbox" value="Your Name" onfocus="inputInlineHint(self);" onblur="inputInlineHint(self);" />
</code></pre>
<p>Now i'd like to retrieve the current value of the field:</p>
<pre><code>function inputInlineHint(e) {
var theValue = '';
//Now i need to retrieve the value... but how?
}
</code></pre>
<p>I hope you guys can help me with that... should be pretty basic but i'm new to jquery.</p>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
2,974,157
| 2,974,158
|
passing query string value from asp.net page to iframe
|
<p>I have an asp.net page with a textbox and a button. on button click, I open a popup and load a page in it using iframe. I want to pass value of textbox as query string to page in iframe. How can I do this?</p>
<p>I tried using server side iframe like this:</p>
<pre><code><iframe id="popupframe" runat="server" src="~/temp.aspx" width="100%" height="455">
</iframe>
</code></pre>
<p>but temp.aspx doesnt load and gives 404. If I use it without server side tag</p>
<pre><code><iframe id="popupframe" src="../../../../temp.aspx" width="100%" height="455">
</iframe>
</code></pre>
<p>Page loads in iframe but I can't pass valuue of textbox to temp.aspx. Please suggest solution. thanks</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
4,494,383
| 4,494,384
|
How to implement random number stream accross high traffic asp.net application with multiple servers
|
<p>This question comes from the knowledge that when <code>new Random()</code> is called very quickly it gets seeded with the same value which I assume is based on <code>DateTime.Now.Ticks</code>.</p>
<p>Suppose you had a high traffic web application on latest versions ASP.NET, IIS, .NET, etc.. which implements an online casino. I would think the simulated slot machines need to pull from a single random number stream.</p>
<p>With high volume situation you might get two slot machines with the same random number generator causing too many big jackpots. I don't have a full understanding of pseudorandom generators but my intuition is that to safely implement an online casino you really need to pull from a single generator that is seeded just once.</p>
<p>One solution I can think of is a synchronized queue with a single thread that pushes the numbers on, but I wouldn't know how to synchronize it across a multi-site application.</p>
<p>Is there a good/standard solution to this scenario?</p>
<p><strong>Update: the actual scenario I'm working on (which really has no chance of getting enough volume to cause a problem)</strong></p>
<p>My real-world situation is that I have a moderately high traffic asp.net web forms site and the requirement to show one of two user controls on each request. I did so with the following code:</p>
<pre><code>// Randomly display one of (FreeCreditScore1, MyFreeScoreNow1)
private void ShowCreditScoreAd()
{
FreeCreditScore1.Visible = (new Random().Next(2) == 1);
MyFreeScoreNow1.Visible = !FreeCreditScore1.Visible;
}
</code></pre>
<p>If I unit test the above code by calling it in rapid succession it fails and I came to understand the reason was that <code>new Random()</code> was getting called in the same "tick".</p>
<p>That said, I do believe my current implementation is sufficient (feel free to correct me) but I was curious how it could be solved if I really wanted to be strict about it...</p>
|
c# asp.net
|
[0, 9]
|
2,781,829
| 2,781,830
|
Javascript jQuery How to load default image if
|
<p>I wanted to load the default image if the user's one didn't exist. I tried this but it didn't work.</p>
<pre><code>$('#avatar').load(function(){
// ... loaded
}).error(function(){
// ... not loaded
$(this).attr('src','/images2/no-avatar2.png');
});
</code></pre>
<p>Anyone know how I could do this?</p>
<p>Someone uses this:</p>
<pre><code>function loadDefault(f, ff) {
img = document.getElementById(f);
if(!img.complete) {
img.src = ff;
}
if(typeof(img.naturalWidth) != "undefined" && img.naturalWidth == 0) {
img.src = ff;
}
}
function init() {
setTimeout("loadDefault('side_avatar', '/images/default/avatar_player_profile.gif')", 100);
setTimeout("imageResize(740)", 100);
tooltip = new ToolTip();
tooltip.init('hoverBox', 'loading...');
}
</code></pre>
<p>How could I use something like this?</p>
|
javascript jquery
|
[3, 5]
|
601,416
| 601,417
|
Jquery animation hover
|
<p>In my website i have an image that when hover it goes up using this.</p>
<p>HTML</p>
<pre><code><div class="first">
<a href="#dialogdemo" name="modal"><img src="images/1sticon.png" alt=" " border="0"/></a>
<div class="support">
<img src="images/orpan.png" alt=" " />
</div>
</div>
</code></pre>
<p>Jquery</p>
<pre><code> $('.first img').hover(
function(){
$(this).stop().animate({marginTop:'-25px',}, 300);
},
function(){
$(this).stop().animate({marginTop:'0px',}, 300);
}
);
</code></pre>
<p>but i have another image at the back of it that when hover i want the image above it to stay on its place and when mouseout it the 1st image above will go down to cover the image under it (back image). </p>
|
javascript jquery
|
[3, 5]
|
6,021,185
| 6,021,186
|
Changing Page on mouse dragging event
|
<p>Have a look the the page.</p>
<p><a href="http://www.trgms.com" rel="nofollow">The Link</a></p>
<p>Now, what I want to do is, that when a user drags the window towards right, the windows drags to the previous page, and vice versa, which is currently being done when user clicks the right or left buttons on the screen. Can anyone please tell me any event which can tell me which way the user is dragging. With dragging, I mean, clicking the mouse, holding the click, moving the mouse and then releasing it.</p>
|
javascript jquery
|
[3, 5]
|
4,404,869
| 4,404,870
|
Fancy box add button onComplete open current image in new window
|
<p>I am trying to extend fancybox to allow for a new button to open the current image in a new window. I was planning on adding this via the onComplete although I can find any information in the API that explains how to get teh current image from:</p>
<pre><code>'onComplete' : function(currentArray, currentIndex, currentOpts){
alert(currentArray.title);
}
</code></pre>
<p>Or if you can point me in the direction of some documentation on how I can use the <strong>"currentArray, currentIndex, currentOpts"</strong></p>
|
javascript jquery
|
[3, 5]
|
5,273,500
| 5,273,501
|
ASP.NET Call Another Element's DoPostBack Function
|
<p>I have an ASP.NET control that has an onclick event handler rendered inline on the element. I would like to call that function and have it raise the target control's server side event handler.</p>
<pre><code><asp:CheckBox ID="Foo"
runat="server"
AutoPostBack="true"
Text="Foo" />
<a href="#"
onclick="javascript:setTimeout('__doPostBack(\'Foo\',\'\')', 0)">Test
</a>
</code></pre>
<p>I created the checkbox, looked at the rendered function on the field, and then copied that into the onclick on the anchor element.</p>
<p>The anchor will raise a postback, but the event handler for the check box is not raised.</p>
<pre><code>protected override void OnLoad(EventArgs e)
{
// fires for checkbox
// fires for anchor (the anchor does cause a postback)
}
void Foo_CheckedChanged(object sender, EventArgs e)
{
// fires for checkbox
// does not fire for anchor
}
protected override void OnInit(EventArgs e)
{
this.Foo.CheckedChanged += new EventHandler(Foo_CheckedChanged);
}
</code></pre>
<p>Is it possible to do this?</p>
|
asp.net javascript
|
[9, 3]
|
2,425,689
| 2,425,690
|
find replace not working in ie
|
<p>Could anyone tell me why the following code doesnt work in ie? it works in every other browser and just comes up as undefined in ie:</p>
<pre><code>var infoTemplate = '<div style="text-align:left"><h4 style="color:#0068a6;font-size:16px;margin:0px 0px 10px 0px;">%Title</h4><strong>%Tel</strong><br /><br />%Add</div>';
var seletedMarker = null;
function composeInfoString(row) {
var $row = $(row);
return infoTemplate.replace('%Title', $row.find('.itemtitle a').html())
.replace('%Tel', $row.find('.tel').html())
.replace('%Add', $row.find('.add').html());
}
</code></pre>
<p>%Title, %Tel, %Add all come up as undefined in IE. Any help gratefully apreciated.</p>
|
javascript jquery
|
[3, 5]
|
3,250,482
| 3,250,483
|
problem with Jquery equivalent to javascript createElement
|
<p>I'm trying to recreate the following code with jQuery:</p>
<pre><code> var node = document.createElement("div");
node.innerHTML = "DynaColumn";
node.className = "ui-state-default ui-corner-all";
return node;
</code></pre>
<p>this is the code I'm trying to get to work:</p>
<pre><code>return $("<div class='ui-state-default ui-corner-all'>DynaColumn</div>");
</code></pre>
<p>The first seems to work fine. I'm not sure why the second isn't working:</p>
<p>The object that will be using this return value is calling it as so: </p>
<pre><code>something.appendChild(theNode);
</code></pre>
|
javascript jquery
|
[3, 5]
|
645,840
| 645,841
|
ASP.NET/C# - Detect File Size from Other Server?
|
<p>I'm trying to find the file size of a file on a server. The following code I got from <a href="http://www.thejackol.com/2005/06/11/aspnet-get-file-size/" rel="nofollow">this guy</a> accomplishes that for your own server:</p>
<pre><code>string MyFile = "~/photos/mymug.gif";
FileInfo finfo = new FileInfo(Server.MapPath(MyFile));
long FileInBytes = finfo.Length;
long FileInKB = finfo.Length / 1024;
Response.Write("File Size: " + FileInBytes.ToString() +
" bytes (" + FileInKB.ToString() + " KB)");
</code></pre>
<p>It works. However, I want to find the filesize of, for example:</p>
<pre><code>string MyFile = "http://www.google.com/intl/en_ALL/images/logo.gif";
FileInfo finfo = new FileInfo(MyFile);
</code></pre>
<p>Then I get a pesky error saying <code>URI formats are not supported.</code></p>
<p>How can I find the file size of Google's logo with ASP.NET?</p>
|
c# asp.net
|
[0, 9]
|
3,882,719
| 3,882,720
|
Read Images programmatically
|
<p>i am a 3rd year computer science student, and my seminar(graduation project) is in the next semester, so i started to think about it and i thought that a face recognition system would be a great idea, so i have two questions:</p>
<p>1- how can i read a picture programmatically, i mean if i have a picture, how can read the pixels and colors in order to recognize the face later on?</p>
<p>2- do you know any useful ebooks or resources that might help me in this topic cuzz i am really interested about it, and i hope that i can implement it.</p>
<p>thank you very much dudes </p>
<p><strong>this is my first post and i hope you will really help me :)</strong></p>
|
c# php
|
[0, 2]
|
135,063
| 135,064
|
Need whole body tag mouseover function
|
<p>I need to whole body mouseover function. When I enter some other page, some of my content will append the particular div. </p>
<p>My code is:</p>
<pre><code>$('body').mouseover(function() {
$('#text').append('<div>New content</div>');
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,005,547
| 4,005,548
|
javascript return function's data as a file
|
<p>I have a function in javascript called <code>"dumpData"</code> which I call from a button on an html page as <code>**onlick="dumpData(dbControl);"*</code> What it does is return an xml file of the settings (to an alert box right now). I want to return it to the user as a file download. Is there a way to create a button when click will open a file download box and ask the user to save or open it? (sorta of like right-clicking and save target as)...</p>
<p>Or can it be sent to a php file and use <code>export();?</code> Not sure how I would send a long string like that to php and have it simple send it back as a file download.</p>
<p>Dennis</p>
|
php javascript
|
[2, 3]
|
4,984,238
| 4,984,239
|
How to get on which html tag i am clicking using jquery?
|
<p>I working on a web page which has a similar structure like this:</p>
<pre><code><div id="mydata">
<img src="" >
<img src="" >
<img src="" >
<video src=""></video>
<video src=""></video>
<img src="" >
<img src="" >
</div>
</code></pre>
<p>so it's a combination of video & images inside mydata div.</p>
<p>Now what i want to do is:</p>
<p>if my user click on image then a alert comes and shows "it's an image" and if click on video then alert shows "it's an video"</p>
<p>please tell me how can i do this using jquery?</p>
|
javascript jquery
|
[3, 5]
|
5,171,913
| 5,171,914
|
How to apply watermark in file upload control
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/11685617/putting-placeholder-attribute-on-file-type-input-field">Putting placeholder attribute on file type input field</a> </p>
</blockquote>
<p><img src="http://i.stack.imgur.com/EZpAf.png" alt="enter image description here"></p>
<p>i want to show something like this..</p>
<p>I have one file-upload control and need to show some value in default file-upload control text box. how it is possible.</p>
|
javascript asp.net
|
[3, 9]
|
4,683,723
| 4,683,724
|
I want show add to cart popup window onclick of view cart link using jquery,javascript or asp
|
<p>Please check bellow link:</p>
<p><a href="http://v1098050.jkgeyrewb7wh.demo10.volusion.com/ProductDetails.asp?ProductCode=MacFRC" rel="nofollow">http://v1098050.jkgeyrewb7wh.demo10.volusion.com/ProductDetails.asp?ProductCode=MacFRC</a></p>
<p>Click on Add to Cart button it shows add to cart popup window
I want to show that add to cart popup window after clicking on View Cart link.
Remember I dont have code of add to cart means I cant change that code only I can access its id's and classes.Only after doing view source I can see code or script for that.<br>
How to do it??</p>
|
javascript jquery
|
[3, 5]
|
1,085,868
| 1,085,869
|
Recording Audio sound on Internet - C# ASP.NET
|
<p>I want build an application on web which records the audio sound through Mic.</p>
<p>If any one can provide some appropriate approach or some links would be helpful.</p>
<p>also if you can suggest some third party control which is free.</p>
<p>The technology for Implementation - ASP.NET , C#</p>
|
c# asp.net
|
[0, 9]
|
3,667,734
| 3,667,735
|
Get textbox value inside templateField tag?
|
<p>How to get textbox value inside <code>templateField</code> tag?</p>
<p>Here's my code:</p>
<pre><code> <Fields>
<asp:TemplateField >
<ItemTemplate >
<asp:TextBox ID="SUBJEK" runat="server" Width="600px" Text='<%# Bind("SUBJEK") %>' />
</ItemTemplate>
</asp:TemplateField>
</Fields>
</code></pre>
<p>And i try to get value with:</p>
<pre><code>TextBox subjek = (TextBox)DV1.FindControl("SUBJEK") as TextBox;
</code></pre>
<p>But, it didnt work. This the error message:</p>
<blockquote>
<p>"Cannot convert type 'System.Web.UI.Control' to 'JobList.TextBox'"</p>
</blockquote>
|
c# asp.net
|
[0, 9]
|
1,756,987
| 1,756,988
|
Using Google Map View on iOS versus on Android
|
<p>on iOS you don't need to specify the Google Map API key. But In android, you do have to specify, so the question why such difference?</p>
|
iphone android
|
[8, 4]
|
2,207,958
| 2,207,959
|
jQuery not removing class on elements
|
<p>I have this code in Javascript</p>
<pre><code>// when I click on any #type_import_block, remove class "active" from all id that contains "ver_"
$("[id*=_import_block]").mousedown(function(){
$("[id*=ver_]").removeClass("active");
});
</code></pre>
<p>But doesn't work, the class "active" isn't removed from <code>#ver_</code></p>
<p>Can someone help me?</p>
|
javascript jquery
|
[3, 5]
|
261,830
| 261,831
|
Problem with string format
|
<p>I would like to assign string "{"MY_URL", "MY"}" to string variable. So in my code behind (C#)
I wrote like <code>string str ="{\"MY_URL\", \"MY\"}"</code>. When i will assign this to textbox it will print escape character ("\") as well. That i don't want so what i have to do to achieve this??</p>
|
c# asp.net
|
[0, 9]
|
930,020
| 930,021
|
Loading an element. After that loading another element into the loaded element
|
<p>i built a website where my frame, with the main menue and the banner, is always exisiting.</p>
<p>I created a div element, in which i can load everything i want dynamically. </p>
<p>But now i have a problem. If somebody clicks a link, i want to load a html document into my div-frame. When this has been done, a another html document should be loaded into a part of the new loaded html document.</p>
<p>The rask is now, to check when the first div element has been loaded and load something into this element.</p>
<p><strong>An Example:</strong></p>
<pre><code>$("#examplelink").click(function()
{
$("#mainsite").load("firstlowerside.html");
$("#firstlowerside_div").load("secondlowerside.html");
});
</code></pre>
<p>Javascript is ignoring the command line:
$("#firstlowerside_div").load("secondlowerside.html")
, because the "firstlowerside.html" isnt already exisiting at this thime.</p>
<p>Can somebody tell my how i can check is the document has been loaded into my div and start executing the second command after this?</p>
|
javascript jquery
|
[3, 5]
|
4,755,918
| 4,755,919
|
Playing a sound from a dynamic generated list
|
<p>I am new to C# and ASP.NET and I currently have a page that is dynamically displaying a list of .wav files from a directory using a checkbox list and displaying the date of the file when it was created. However since that is a .wav file I am trying to allow the end user to be able to play it but I am not sure where to start.</p>
<p>Any help will be appreciate it.</p>
<p>Here is the code that I have so far.</p>
<pre><code>if (filesDate > fromDate && filesDate < toDate)
{
Response.Write("<input name=\"" + filePath + "\" type=\"checkbox\" value=\"" + filePath + \"/> <strong>Recording created on: " + filesDate + "</strong><br/>");
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,716,971
| 2,716,972
|
Asp.net Calendar control
|
<p>I have an asp.net calendar control that is used to select a date and store it in a database. It is also adding the time which makes reporting difficult. We only need the date not the time. How can I prevent the calendar control from including the time....or making the time the same for every date?</p>
|
c# asp.net
|
[0, 9]
|
222,378
| 222,379
|
how to refresh the asp.net Label every second automatically using Java script instead ajax?
|
<p>how to refresh the asp.net Label every second automatically using Java script instead ajax?</p>
|
javascript asp.net
|
[3, 9]
|
4,658,382
| 4,658,383
|
cell of a datagridview to support multiple lines using c#
|
<p>i have a datagrid view with two columns. the first column is readonly and the other is editable. now i want every cell of the second column to support for mulitilines in each cell. i want to press enter key and come to the next line in the same cell.
im using c#.</p>
|
c# asp.net
|
[0, 9]
|
693,575
| 693,576
|
How can I get the URL of a link?
|
<p>How can I get the URL of a link?</p>
<pre><code>$('.l').eq(0).href
</code></pre>
<p>is what I want to do, but it's undefined. </p>
<hr>
<p>So given a jQuery selected anchor element, how do you get the href property?</p>
|
javascript jquery
|
[3, 5]
|
5,264,764
| 5,264,765
|
How to execute in JavaScript function in ASP.NET using C#
|
<p>i have a textarea which i want to disable when I check a <code>checkbox</code>. I made a working demo in plain HTML and JavaScript , but When I am migrating to Asp.net, neither the function is being executed nor I can keep the <code>OnSelect</code> event in my check box.</p>
<pre><code><asp:CheckBox ID="ChkOthers" runat="server" Text="Others(Please Explain)" Width="205px" AutoPostBack="True" OnCheckedChanged="ChkOthers_CheckedChanged" />
<asp:TextBox ID="TxtOtherReason" runat="server" MaxLength="1024" TextMode="MultiLine" />
</code></pre>
<p>i want to create client side validation when check box is checked textbox is enable else disable.</p>
|
c# asp.net javascript
|
[0, 9, 3]
|
2,481,073
| 2,481,074
|
jQuery string split the string after the space using split() method
|
<p>my code </p>
<pre><code> var str =$(this).attr('id');
</code></pre>
<p>this will give me value == <strong>myid 5</strong></p>
<pre><code> var str1 = myid
var str2 = 5
</code></pre>
<p>i want something like this ..</p>
<p>how to achieve this using split method</p>
|
javascript jquery
|
[3, 5]
|
606,875
| 606,876
|
Access datas based on user role in asp.net
|
<p>How to access datas based on user roles in asp.net ?</p>
<p>For example : i have two admins (admin1, admin2) .</p>
<p>In the frontend ,admin1 has full access to datas(view,add,edit,delete all datas) </p>
<p>while admin2 has limited access to datas(view,add,edit,delete certain datas alone and not all datas)</p>
<p>thank you</p>
|
c# asp.net
|
[0, 9]
|
2,968,921
| 2,968,922
|
List Items with alternating colours
|
<p>I have my template file which has data being populated into it. However I want to be able to write a class to every odd list element.</p>
<p>The issue i have is that some of the fields being listed are hidden when there is no data and as such i cannot simply write in the class of every other element.</p>
<p>I know I could do this using javascript, but would prefer not to.</p>
<p>Is there any way I can use the page_prerender to look at which list items are going to be displayed and add a class to each odd element?</p>
<p>for example my template looks like this but with many more fields:</p>
<pre><code> <ul>
<li>
<h3>Data title</h3>
<p><%=GetDymanicData1 %></p>
</li>
<!-- if statement to check if data has value, else do not show -->
<li>
<h3>Data title</h3>
<p><%=GetDymanicData2 %></p>
</li>
<li>
<h3>Data title</h3>
<p><%=GetDymanicData2 %></p>
</li>
...
</ul>
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,387,144
| 3,387,145
|
Cannot seem to get user location
|
<p>I've been trying to get the longitude and latitude of a users location with Android. I've been trying to use the LocationManger however it does not seem to activate and give me an update. Here is the code, any ideas what I'm doing wrong?</p>
<pre><code>LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);// Define a listener that responds to location updates
LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location location) { // Called when a new location is found by the network location provider.
System.out.println(location.getLatitude());
System.out.println(location.getLongitude());
locationplace = location.getProvider();
}
public void onStatusChanged(String provider, int status, Bundle extras) {}
public void onProviderEnabled(String provider) {}
public void onProviderDisabled(String provider) {} };// Register the listener with the Location Manager to receive location updates
//locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
System.out.println(locationplace);
</code></pre>
|
java android
|
[1, 4]
|
1,516,711
| 1,516,712
|
jQuery "Microsoft JScript runtime error: Object expected"
|
<p>I have the below code that does not seem to work at all :( I keep getting:</p>
<pre><code>Microsoft JScript runtime error: Object expected
</code></pre>
<p>The error seems to occur when the timeout is done. So if I raise the timeout with 10 seconds the error holds for another 10 seconds. </p>
<p>I want to be able to update the number of friends online async. The number is shown with the following html:</p>
<pre><code><a href="" id="showChat" >Friends online <strong id="friendsOnline">(?)</strong></a>
</code></pre>
<p>The friends part is set at the first run, but when the timeout calls back it does not fire again. Also, I cannot see on which line the error occurs because if I want to break on the error it just shows "no source code" etc.</p>
<p>The code below is the code I'm using. Thanks!</p>
<pre><code><script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.js" type="text/javascript"></script>
<script src='/Scripts/MicrosoftAjax.js' type="text/javascript"></script>
<script src='/Scripts/MicrosoftMvcAjax.js' type="text/javascript"></script>
<script src='/Scripts/jquery.autocomplete.js' type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
UpdateFriendsOnline();
function UpdateFriendsOnline() {
window.setTimeout("UpdateFriendsOnline()", 1000);
$.get("/Account/GetFriendsOnline", function(data) {
$("#friendsOnline").html("(" + data + ")");
});
}
});
</script>
</code></pre>
|
c# jquery javascript
|
[0, 5, 3]
|
3,461,600
| 3,461,601
|
How to set a control in parent window based on selection in jquery dialog
|
<p>I am launching an aspx page within a jquery dialog using</p>
<pre><code>var url = "SomePage.aspx";
$("#divPop").load(url).dialog({
position: '50px',
modal: true,
closeText: '',
bgiframe: true,
height: 'auto',
width: '1000',
open: function (event, ui) {
},
close: function (event, ui) {
}
}).dialog("open");
</code></pre>
<p>Within the popped up aspx on selection< i pick a row in a jqgrid. </p>
<p>On closing the dialog, I want to be able to set the value for a textbox in the
calling page using the selection from the dialog. Different pages can
launch the same aspx using a dialog and I wish to be able to set the value for
the textbox with different ids in the different pages</p>
|
javascript jquery
|
[3, 5]
|
1,973,852
| 1,973,853
|
Redirect a user after update
|
<p>I have a page that users will click a update link and once they land on the page it will tell the server to grab data from a API and takes a few minutes. The problem is I don't wan't to have to keep refreshing the page to send the user back once it has updated.</p>
<p>Is there a jQuery function that will check a PHP file every 10 seconds and if the PHP files says example yes it will the redirect them. </p>
<p>Sorry I'm new with jQuery.</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,610,371
| 4,610,372
|
Javascript loaded check through jquery getscript
|
<p>I want to load a Javascript file on the click event instead of loading at the page load event, for performance reasons.
Is there anyway to know that particular if javascript is already loaded?</p>
<p>Right now I am maintaining a global variable to check the 'loaded' event</p>
<pre><code>var javascriptLoaded=false
if (!javascriptLoaded)
$.getScript('/scripts/test.js', function() {
javascriptLoaded = true;
setTimeout(function() {
callSomeFunctionhere();
}, 1000);
});
</code></pre>
<p>Is there any better way of doing this?</p>
|
javascript jquery
|
[3, 5]
|
1,011,405
| 1,011,406
|
How to pass the value of an option field as well as an input box via post in jquery/PHP?
|
<p>I have a search bar like</p>
<pre><code><div id="searchbar">
<form>
<select name="Cars">
<option value="big">Big Cars</option>
<option value="small">Small Cars</option>
</select>
<input type ='text' name="searchkey" id ="search" onblur ='setTimeout('removeSearchSuggestions()', 20);' onkeyup ='getSearchSuggestions(this.value);'/>
&nbsp;
<br/>
<div id = 'searchsuggest'></div>
<input type ='submit' value = 'Search' />
</form>
</div>
</code></pre>
<p>and i have the following jquery code snippet</p>
<pre><code>function getSearchSuggestions(value){
if (value !=""){
$.post("searchSuggest.php", {searchPart:value}, function(data) {
$("#searchsuggest").html(data);
doSearchCSS();
});
} else {
removeSearchSuggestions();
}
}
</code></pre>
<p>So searchSuggest has access to "searchPart" i.e. the value that is typed into the input box. I am modifying something I got to work for a case without options. How do I modify the jquery function to access the selected option in searchSuggest.php? </p>
<p>Thanks!</p>
|
php javascript jquery
|
[2, 3, 5]
|
508,936
| 508,937
|
jQuery multiple callbacks to one callback counting calls
|
<p><strong>I need just one callback at the and of multiple callbacks. With a simple "class" MultiCallback that count the calls it seems to be solved.
But the fadeIn function of jQuery calls mCallback just once.</strong></p>
<p>It have to call mCallback 3 times. That happens by using a callback function directly inside top scope.</p>
<p>Tested my MultiCallback class also on my own functions without any problems. I know
there a other ways like <a href="http://stackoverflow.com/questions/7378349/hide-multiple-elements-with-jquery-and-get-one-callback">Hide multiple elements with jQuery and get one callback</a>...
Just wanna know what is wrong with my logic.</p>
<pre><code><div id="1" style="display: none; background-color: green;"></div>
<div id="2" style="display: none; background-color: red;"></div>
<div id="3" style="display: none; background-color: blue;"></div>
<script>
var allElements = "#1, #2, #3";
var multiCallback = new MultiCallback( $(allElements).length, function()
{
console.log("NEVER ENTER CALLBACK");
});
$(allElements).fadeIn(400, multiCallback.mCallback());
function MultiCallback(limit, fn)
{
var finishedCalls = 0;
function mCallback()
{
// Just enter one time !
if (++finishedCalls == limit)
{
fn();
}
}
return {
mCallback : mCallback
}
}
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,513,440
| 5,513,441
|
deferring JavaScript execution in document received via AJAX
|
<p>I'm receiving this HTML document via AJAX:</p>
<pre><code> <form enctype="multipart/form-data" method="POST" action="admin.php?do=media&action=file-upload">
<div id="uploadForm">
<div id="fileList">
</div>
<a href="#" id="selectFile">[Select File]</a>
<a href="#" id="uploadFile">[Start Upload]</a>
</div>
</form>
<script type="text/javascript">
// $(function(){}); not working when data loaded with ajax request
var ajaxUpload = new plupload.Uploader({
runtimes: 'gears, html5, flash',
url: 'upload.php',
browse_button: 'selectFile',
});
ajaxUpload.bind('Init',function(param){
console.log(param);
console.log($('selectFile'));
});
$('#uploadFile').click(function(){
alert('Something');
});
ajaxUpload.init();
</script>
</code></pre>
<p>When I append this to the main document, the JavaScript inside it will immediately run and not be able to find the referenced DOM elements.</p>
<p>It works when I add a time-out on the code, but I would like to know a better way at achieving this.</p>
<p><strong>Update</strong></p>
<p>Modified to reflect the true intent of the question.</p>
|
javascript jquery
|
[3, 5]
|
1,872,821
| 1,872,822
|
Appended span tags don't have assigned text
|
<p>I'm trying to iterate over a collection of checked checkboxes and append the text of each checked box to a div as a span. I've tried this with option tags to a select and it works fine, but when doing it with span tags, the text doesn't seem to be showing.</p>
<pre><code>$.each(elms, function(index, value) {
var textVal;
textVal = $.trim($(value).parent().text());
return $('#narrowSic').append($('<span class=label>', {
text: textVal
}));
});
</code></pre>
<p>This is the HTML that it's being used with:</p>
<pre><code> <div id="filteredSicDiv">
<a href="javascript: void(0)">Clear</a>
<div id="narrowSic" class="labelParent">
Sic:</div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,779,049
| 3,779,050
|
Multiple JQuery plugins on same page
|
<p>I am wondering if there is an easy solution to this:
I have the following JQuery plugin created several times on elements defined in a grid</p>
<pre><code>(function ($) {
$.fn.MyPlugin = function () {
$(this).mouseenter(function () {
//do something for single plugin instance
});
};
})(jQuery);
</code></pre>
<p>However, how can I go about uniquely identfying which plugin instance I am triggering the mouse enter function on. With the current setup I am referencing all the instances, but I want to only trigger the mouseenter for one of them at the time.</p>
<p>The plugin is created like this:</p>
<pre><code>$(".someClass").MyPlugin();
</code></pre>
|
javascript jquery asp.net
|
[3, 5, 9]
|
3,107,367
| 3,107,368
|
large table with lots of events, is using event bubbling more effecient?
|
<p>I have a large table/grid that has events on each row, table headers, etc.</p>
<p>Instead of me generating events or binding events to each cell, would it be better to put a 'global' event and then I believe when clicked or mouseover events occur, it will bubble up to my 'global' event on the entire table and then I get filter the event caller and react.</p>
<p>I've read about this before, but not sure if I have the idea correct.</p>
<p>Are there any gotcha's with this approach?</p>
|
javascript jquery
|
[3, 5]
|
5,707,571
| 5,707,572
|
How to test android method with J2SE
|
<p>I have some dynamically generated Android classes. I need to test some of the methods of those classes (these methods have nothing to do with UI). I hope to integrate this feature into an existing J2SE project. Is this possible to run it on standard VM? If I have to use Dalvik VM, is there any command line interface so that I don't need to start the Android emulator?</p>
|
java android
|
[1, 4]
|
3,482,230
| 3,482,231
|
How to call a class in the App_Code folder from code behind?
|
<p>I created a class in ASP.NET C# which is located in the App_Code folder. Now I want to call this class from my code behind from one of my .aspx pages. How can I do this?</p>
<p>Any help will be appreciate it.</p>
|
c# asp.net
|
[0, 9]
|
4,443,494
| 4,443,495
|
PHP/JavaScript How to combine 2 page in one
|
<p>I need a reference on how to make 2 pages become one.</p>
<p>Originally i have 2 php pages. View.php and comment.php</p>
<p>The view.php will have a link to call comment.php. When click the 'comment' link, it will open comment.php like pop up. After fill in the comment, and click send, it will closed and return the view.php. </p>
<p>The problem is, Instead of popup i want it hide until i click it. I dont know what is the exact term to call this process. I know it got something to do with javascript, using id, onclick function and similar to frame function. Because i dont know what it call, it hard for me to research. So anyone please tell me what it called or gimme any references or example solution on how to do it.</p>
<p>thank you very much</p>
<p>UPDATED:</p>
<p>dear all..</p>
<p>found this code in internet. Like RageZ said..it uses css and javascript to show and hide img. how to use for others? </p>
<p>do i need to convert my comment.php into a function and put in view.php n use the id for that function. is it possible?</p>
<pre><code><html>
<head>
<script>
function changeme(id, action) {
if (action=="hide") {
document.getElementById(id).style.display = "none";
} else {
document.getElementById(id).style.display = "block";
}
}
</script>
</head>
<body>
<img id="myIMG" style="display: none;" src="question.php.html"width="100" height="100" />
<span onclick="changeme('myIMG', 'show');" style="color: blue; text-decoration: underline; cursor: pointer;">Show the image</span>
<span onclick="changeme('myIMG', 'hide');" style="color: blue; text-decoration: underline; cursor: pointer;">Hide the image</span>
</body>
</html>
</code></pre>
|
php javascript
|
[2, 3]
|
2,284,447
| 2,284,448
|
change class on LI click
|
<p>I need to dinamically assign a .selected class to the element where I click and also remove any other previous class asigned to the clicked element so I can change CSS class. Maybe this code:</p>
<pre><code>$(this).click(function(){
$(this).addClass('selected');
});
</code></pre>
<p>works but what happend if I click in any other LI? Any help to get this work?</p>
<p>EDIT:
Ok see this code:</p>
<pre><code><ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</code></pre>
<p>By default none have any classes but I click in Item 2 then the HTML should transform on this one:</p>
<pre><code><ul>
<li>Item 1</li>
<li class="selected">Item 2</li>
<li>Item 3</li>
</ul>
</code></pre>
<p>but once again if I click in Item 3 then the HTML should transform on this one:</p>
<pre><code><ul>
<li>Item 1</li>
<li>Item 2</li>
<li class="selected">Item 3</li>
</ul>
</code></pre>
<p>This is what I'm trying to do</p>
|
javascript jquery
|
[3, 5]
|
4,653,585
| 4,653,586
|
A Safe Path to External Storage
|
<p>For my app, I have a fairly large database that needs to be stored on the user's device. I plan to change this in the future. For now, however, I'd like to store it to the user's external storage (if available) rather than fill up their internal storage. What method can I use to get a safe (meaning, will work on most devices) path to the external storage?</p>
|
java android
|
[1, 4]
|
1,474,368
| 1,474,369
|
replacing page content with .html(content) is not working
|
<p>I have a weird problem in jQuery. The problem is that I can smoothly use <code>$('#container').html(content)</code> to replace the page content but to specific page. It is not working all around. Gives 'TypeError' message in console. Is there any probability that using SlickGrid can cause such error. Because error is thrown only in that pages where I have used SlickGrid. </p>
<p>Any suggestion would be highly appreciated.</p>
|
javascript jquery
|
[3, 5]
|
5,991,566
| 5,991,567
|
C# and Java : 3 / 2 * 3.2 = 3.2, why?
|
<p>Conside the following for C# and Java,</p>
<pre><code>double d = 3 / 2 * 3.2;
</code></pre>
<p>Java</p>
<pre><code>System.out.println(d); // 3.2
</code></pre>
<p>C#</p>
<pre><code>Console.WriteLine(d); //3.2
</code></pre>
<p>It skip the 3/2,</p>
<p>We know that the correct answer should be 4.8</p>
<p>if i change to </p>
<pre><code>double d = 3.00 / 2 * 3.2;
</code></pre>
<p>I can get 4.8,</p>
<p>So i want to ask, if (3 / 2 * 3.2) is illegal , why eclipse and vs2008 have no error?
And how to prevent this problem in both C# and Java?</p>
|
c# java
|
[0, 1]
|
459,428
| 459,429
|
Exclude a certain div in jQuery global validation?
|
<p>Okay, so we have around 30 input boxes in our page, and instead of writing a no data line for each one, we have a simple statement:</p>
<pre><code>if( $(div).find('input:text[value=""]').length > 0 ||
$('#checkbox1Wrap').find('input:checkbox:not(:checked)').length > 0 ||
$('#checkbox2Wrap').find('input:checkbox:not(:checked)').length > 0 ||
$(div).find('select option:first-child:selected').length > 0 ||
$(div).find('textarea').val() == ""
){
$(div).prepend('<p class="field_help"> Please complete all fields before moving to next step</p>');
return false;
}
</code></pre>
<p>This checks all input fields to check if their length is more than 0, but we want to exclude certain fields from being checked.</p>
<p>For example:</p>
<pre><code><input type="text" autocomplete="off" value="" name="ext" id="ext">
</code></pre>
<p>We don't want the above input field to be checked.</p>
<p>How can we make it so the if statement skips certain defined IDs?</p>
|
javascript jquery
|
[3, 5]
|
3,908,031
| 3,908,032
|
how to add an OnClick event on DropDownList's ListItem that is added dynamically?
|
<p>Say I have the following code:</p>
<pre><code> DropDownList changesList = new DropDownList();
ListItem item;
item = new ListItem();
item.Text = "go to google.com";
changesList.Items.Add(item);
</code></pre>
<p>How do you dynamically add an OnClick event to <code>item</code> so that google.com will be visited after clicking on the <code>item</code>?</p>
|
c# asp.net
|
[0, 9]
|
309,239
| 309,240
|
Jquery perform click on <img>
|
<p>I am working with an external JavaScript plugin that I can not edit and works by click on the a list of thumbnail images. </p>
<p>For styling purpose I have had to wrap the images in an <code><a></code> with:</p>
<pre><code>if(img.parent("a").length == 0){
img.wrap('<a />');
}
</code></pre>
<p>Is there a way I can add a click for the <code><a></code> I have inserted which then makes this JavaScript plugin call the actions for click on a image. </p>
<p>I have tried this although doesn't work and gives the error: <code>Too much recursion</code>:</p>
<pre><code>$("#thumbs a").live("click", function(){
$(this).find("img").click();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,964,730
| 2,964,731
|
How do I modify a string printed by a script?
|
<p>I'm having problems with wordpress mishandling accented characters, or maybe the problem is with some plugin. Whichever the case I need to "translate" some strings, removing accents which i do with:</p>
<pre><code> $value = strtr($value, $trans);
</code></pre>
<p>I really need to change this string which renders the user's location but it's printed with a script so I have no idea how to do it:</p>
<pre><code><script language="javascript"> document.write('' + geoip_city() +''); </script>
</code></pre>
<p>Is there a way to assign it's result to a php value beforehand or something? Maybe removing the accents with a script. I really need to modify it, how could I manage to do it? Thanks</p>
|
php javascript
|
[2, 3]
|
5,566,633
| 5,566,634
|
Unable to catch the Dropdown selected value in a textbox inside a repeater
|
<p>I have a <code>DropDownList</code> inside a repeater and whenever the selected text is changed, I have to show it in a <code>TextBox</code> but I'm getting <code>Object reference not set to an instance of an object</code> error</p>
<pre><code>protected void Ddl_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddl = (DropDownList) sender;
RepeaterItem item = (RepeaterItem) ddl .NamingContainer;
TextBox txt = (TextBox) item.FindControl("TextBox4");
txt.Text = ddl.SelectedItem.Text;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,738,948
| 4,738,949
|
PHP and JavaScript Buttons not working?
|
<p>My code (Below) works in Internet Explorer, but not in Chrome, Safari or Mozilla Firefox. Not sure why, but would it be possible for someone to point me in the right direction? This code has some buttons which change the form's action attribute and direct the data to different PHP controller file to do different things such as create user, modify user etc</p>
<p><strong>JavaScript code:</strong></p>
<pre><code><script language="javascript">
function formAction(flag) {
switch (flag){
case "create":
document.forms.useraction.action = "/apps/portal_admin/create_user1.php";
break;
case "modify":
document.forms.useraction.action = "/apps/portal_admin/modify_user1.php";
break;
case "copy":
document.forms.useraction.action = "/apps/portal_admin/copy_user1.php#user2";
break;
}
document.forms.useraction.submit();
}
function helloworld() {
alert("Hello World");
}
</script>
</code></pre>
<p><strong>PHP code:</strong></p>
<pre><code><?php
if ($authlib->auth_authobj($posting_userid,$_COOKIE['shost_app_id'],'002')>=2) {
echo "<input type=\"button\" value=\"Create User\" class=\"formButton\" name=\"create\" id=\"create\" onClick=\"formAction('create')\">\n";
echo "<input type=\"button\" value=\"Copy User\" class=\"formButton\" name=\"copy\" onClick=\"formAction('copy')\">\n";
}
if ($authlib->auth_authobj($posting_userid,$_COOKIE['shost_app_id'],'002')>=3) {
echo "<input type=\"button\" value=\"Edit User\" class=\"formButton\" name=\"modify\" onClick=\"formAction('modify')\">\n";
echo "<input type=\"button\" value=\"This button works\" class=\"formButton\" name=\"Working\" onClick=\"helloworld()\">\n";
}
?>
</code></pre>
|
php javascript
|
[2, 3]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.