|
I have two data grids in a page...both has check box column(for check & uncheck all)...
header template check box id checkall(dg1) & checkall1(dg2)...
item template check box id chkdelete(dg1) & chkdelete1(dg2)...
when i click checkall(dg1) even check boxes in dg2 are selected...but when i click checkall1(dg2) only dg2 is clicked...
this is js i'm using...i know there is a silly mistake, but donno where to fix it...
(dg1)
function CheckAllDataGridCheckBoxes(CheckBoxControl)
{
var frm = document.forms[0];
if (CheckBoxControl.checked == true)
{
var i;
for (i=0; i<frm.length; i++)
{
if (frm.elements[i].name.indexOf('chkdelete')!=-1)
{
document.forms[0].elements[i].checked = true;
}
}
}
else
{
var i;
for (i=0; i<frm.length; i++)
{
if (frm.elements[i].name.indexOf('chkdelete')!=-1)
{
document.forms[0].elements[i].checked = false;
}
}
}
}
(dg2)
function CheckAllDataGridCheckBoxes1(CheckBoxControl)
{
var frm = document.forms[0];
if (CheckBoxControl.checked == true)
{
var i;
for (i=0; i<frm.length; i++)
{
if (frm.elements[i].name.indexOf('chkdelete1')!=-1)
{
document.forms[0].elements[i].checked = true;
}
}
}
else
{
var i;
for (i=0; i<frm.length; i++)
{
if (frm.elements[i].name.indexOf('chkdelete1')!=-1)
{
document.forms[0].elements[i].checked = false;
}
}
}
}
|
|
|
|
|
The online visible difference is on this line;
if (frm.elements[i].name.indexOf('chkdelete')!=-1)
Compared to
if (frm.elements[i].name.indexOf('chkdelete1')!=-1)
Could it be that the first should point to "chkdelete2" or something similar?
I are Troll
|
|
|
|
|
yea after changing that...it got fixed...after posting it, i thought of that
thanx bro...
|
|
|
|
|
You're welcome
I are Troll
|
|
|
|
|
I have an asp page with two repeaters on it that each contain a ul list that I bind in the Page_Load method when the page loads and everything works hunky dorey. Once the page is loaded I use JQuery to move the items from one list to the other an example of what I am doing can be found here[^], and that works great. When I submit the page I pass the information regarding what items where moved etc.. using a hidden field and can access it server side just fine. But my problem lies in that the OnItemDataBound does not get called when a post back is done and even if it did I think it would be out of sequence and I would not be able to do the binding that way either. So my question is, is there a way using ajax or whatever to get the repeaters to rebind somehow.
I hope this makes sense
Thanks,
Mike
"It doesn't matter how big a ranch ya' own, or how many cows ya' brand, the size of your funeral is still gonna depend on the weather." -Harry Truman.
Semper Fi
http://www.hq4thmarinescomm.com[ ^]
My Site
|
|
|
|
|
I want to understand how I can difference two request which were rised at the same time??
for example:User A want to buy some product and this product has price for example 5$, this User has only 10$ and increase price to 10$ but at the same time another User B increases price too, and his request postback faster than User A, because A has Slow internet...When A's request at last reaches to the server price is already changed and it's 10$ because of B and after that it will be 15$...
sorry for my English
C# Developer
|
|
|
|
|
I need to setup a web page so that a user cannot select text AND images. I am currently using
onselectstart="return false;"
in the body tag and that works fine for text, but images can still be selected.
This project is not a general purpose/public access website. I am building a kiosk-style system using HTML and Google Chrome as the browser. The system is designed to be interacted with via touch screen. Currently, if the user slightly moves their finger while touching an icon, the browser selects the icon and highlights it in blue. This isn't visually desirable. Is there a way to prevent this without modifying the Google chrome source code. I'm pretty sure I've seen sites that do something like this, but I can't find one right now and I'm just not sure what is the best method.
Thanks
|
|
|
|
|
Also use
ondragstart="return false"
It will solve your problem
|
|
|
|
|
Thanks. That worked perfectly.
|
|
|
|
|
Hi,
I am working with ADFS 2.0.I am creating a sample application on it.I have gathered information about it.
But may be my firewall is blocking it or some ports may not be enable for it.Can anyone tell me what ports need to be enabled for it.I am not sure this is right place to post this.ASAP
Thanks,
Maxy.
|
|
|
|
|
The cursor display with hand as default in the area that html tag defines.I want to change it with others. I tried to do it by using the "style" attribute,but it didn't works.
It is means that the "" doesn't support the cursor style?
|
|
|
|
|
No, the <area> tag doesn’t have a cursor style attribute
|
|
|
|
|
hiiiiiiii
any one can tell me from where i can download free Flash Slideshow Maker trial version for 30 days
Please answer me ASAP
rizvan sivally
|
|
|
|
|
Google[^]
Was not hard to find.
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
www.advance2000.net/upload/encode.php
if you look at that site i have a dynamic "table" that is filled out by the user, and i have the function in "onchange" that would change the subtotal values by multiplying the unit price and the quantity. here is the function of addrows of the dynamic table and the function for adding.
my problem is that the function only works for the first row and after that the value of the subtotal that is saved at the database is always 0. can someone help me through this?
function addRow(tbl,row){
row_no++;
if (row_no<=200){
if (row_no>=10){
var textbox = '';}
if (row_no<10){
var textbox = '';}
var textbox2 = '';
var textbox3 = '';
var textbox4 = '';
var textbox5 = '';
var tbl = document.getElementById(tbl);
var rowIndex = document.getElementById(row).value;
var newRow = tbl.insertRow(row_no);
var newCell = newRow.insertCell(0);
newCell.innerHTML = textbox;
var newCell = newRow.insertCell(1);
newCell.innerHTML = textbox2;
var newCell = newRow.insertCell(2);
newCell.innerHTML = textbox3;
var newCell = newRow.insertCell(3);
newCell.innerHTML = textbox4;
var newCell = newRow.insertCell(4);
newCell.innerHTML = textbox5;
}
if (row_no>200){
alert ("Too Many Items. Limit of 200");
}
}
function Sum() {
var q=document.getElementById("quantity[]").value
var x=document.getElementById("desc[]").value
var y=document.getElementById("itemno[]").value
var o=document.getElementById("ourcost[]").value
document.getElementById("ourcost[]").value=x*y
}
|
|
|
|
|
IDs in HTML should be unique, but every row you add has the same IDs in it, "quantity[]", "desc[]", "itemno[]" and "ourcost[]". The Sum function is only finding the first occurrence of each of the IDs and adding them up, though it would need to loop over all the rows in the table calculating the subtotal for each row.
Try using the row number as part of the ID, then you will be able to reference them individually using a for loop.
|
|
|
|
|
how exactly do i do that? i am new to JS and PHP so i don't know how to do it. can you at least show me how to do it? thanks.
|
|
|
|
|
OK, I'll use the first input as an example:
var textbox = '<input type="text" id="quantity' + row_no +
'" size="85" maxlength="10" name="quantity[]">';
- so your input will have IDs that end with the row number. Your Sum function can then loop over all the rows and updated the cost for each row:
function Sum()
{
for(var i = 1; i <= row_no; ++i)
{
var x = document.getElementById("desc" + i).value;
var y = document.getElementById("itemno" + i).value;
document.getElementById("ourcost" + i).value = x * y;
}
}
By the way, having the description field called "quantity" and the quantity field called "desc" is not helpful.
|
|
|
|
|
Thank you sir i got it to actually work, is it okay if i ask one last question? the values of the textbox "ourcost" is computer by multiplying x to y right? the outputs are correct but once i saved it in the database. it value that is saved is always 0. is there a way to get through this?
|
|
|
|
|
In your form you've got the input disabled - that means the value won't be passed through. Try "readonly" instead.
|
|
|
|
|
Thank you! you have been a great help to me... We finally got it to work. thanks again.. cheers!
|
|
|
|
|
sorry to interrupt again, i have another question regarding the code... how can you add another textbox at the bottom that adds all the sub_total to produce the grand total? i tried this but it does not work.
function Grand()
{
for (var i=1;i<=row_no; ++i)
{
var x=document.getElementById("ourcost"+i).value;
document.getElementById("total").value += parseInt("ourcost"+i).value;
}
i placed this function on the textbox "subtotal" on a "on Change" method.
|
|
|
|
|
Just add the total into the existing Sum function:
function Sum()
{
var total = 0;
for(var i = 1; i <= row_no; ++i)
{
var x = document.getElementById("desc" + i).value;
var y = document.getElementById("itemno" + i).value;
var subtotal = x * y;
total += subtotal;
document.getElementById("ourcost" + i).value = subtotal;
}
document.getElementById("total").value = total;
}
|
|
|
|
|
I'm hoping someone can help. I'm very new to javascipt and am attempting to create a form that has hidden values to pass to Bing Search. I'm also trying to add a drop down menu that causes the value from the option the user changes to be passed along in the same url.
In short, if the user adds "java" in the text box and chooses "dallas" from the drop down menu it will incorporate these variables into the url along with the hidden words that are static, being "resume NOT jobs NOT apply". The url would end up looking something like: http://www.bing.com/search?&q=Resume+-jobs+-apply+java+"Dallas"
This is the code I have currently, that just fails
<script>
function converturl() {
document.go.url.value = document.go.url.value.replace(/\s/g, "");
var url = document.getElementsByName("url")[0];
var city = document.getElementsByName("city")[0];
var fullurl = document.getElementsByName("fullurl")[0];
fullurl.value = "http://www.bing.com/search?&q=Resume+-jobs+-apply+-submit+-required+-wanted+-template+-wizard+-free+-write+-sample+" + url.value.city
}
</script>
<form name= "go" onsubmit='converturl();location.href=fullurl.value.city;return false'>
<input name='url' type='text' /> <input name='fullurl' type='hidden' />
<select name="city"
OnSubmit='converturl();location.href=fullurl.value.city;return false'>
<option value="Dallas">Dallas
<option value="Chicago">Chicago
<option value="New York">New York
</select><input type='submit' value=" Go " />
</form>
<b>This script seems to work, but doesn't pass the city variable (url2) to bing.</b>
<script>
function converturl() {
document.go.url.value = document.go.url.value.replace(/\s/g, "");
var url = document.getElementsByName("url")[0];
var url2 = document.getElementsByName("url2")[0];
var fullurl = document.getElementsByName("fullurl")[0];
fullurl.value = "http://www.bing.com/search?&q=Resume+-jobs+-apply" + url.value
}
</script>
<form name= "go" önsubmit='converturl();location.href=fullurl.value;return false'>
<input name='url' type='text' /> <input name='fullurl' type='hidden' />
<input type='submit' value=" Go " />
</form>
<select name="city"
önSelect="location.href=url2.city.options[selectedIndex].value">
<option selected>Please Select...
<option value="Dallas">Dallas
<option value="Chicago">Chicago
<option value="New York">New York
</select>
modified on Tuesday, January 26, 2010 3:39 PM
|
|
|
|
|
<form action="" method="GET" onsubmit="location.href=converturl();return false">
<input name='url' type='text' />
<input name='fullurl' type='hidden' value='Resume+-jobs+-apply+'/>
<select name="city">
<option value="Dallas">Dallas
<option value="Chicago">Chicago
<option value="New York">New York
</select>
<input type='submit' value=" Go " />
</form>
<script>
function converturl(){
frm=document.forms[0];
return "http://www.bing.com/search/?q=" +
frm.fullurl.value +
frm.url.value + '+' +
frm.city[frm.city.selectedIndex].value
}
</script>
|
|
|
|