|
Do you want to validate only those validation they are available only on first tab or selected tab using javascript?
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
Isn't that a question and should have a Question or General icon?
..Go Green..
|
|
|
|
|
I guess this could be considered a tip as well as a possible question.
I've found that if I have a table with the first row having a colspan value, i.e. header for the table, then deleting the last remaining row below the colspan row deletes the colspan row too.
Check it out - paste the following into an .html, add a few rows, then delete a few rows.
<html>
<head><title>JS Dynamic Table Test</title>
<script language="JavaScript">
<!--
function AddRow() {
var a_misctext = ["Gary","Mary","Larry","Harry","June","Marge","Lisa","Tina","Rika","Susan"];
tbl = document.getElementById('DataArea');
lastrow = tbl.rows.length;
workrow = tbl.insertRow(lastrow);
workrow.insertCell(0);
workrow.cells[0].innerHTML = "<nobr>"+a_misctext[Math.floor(Math.random()*10.0)]+"</nobr>";
workrow.insertCell(1);
workrow.cells[1].innerHTML = "<input type=\"button\" value=\"x\" onClick=\"PopRow(this.parentNode.parentNode.rowIndex);\">";
return false;
}
function PopRow(x) {
document.getElementById('DataArea').deleteRow(x);
}
</script>
</head>
<body>
<form>
<table id=DataArea cellpadding=4 cellspacing=0 border=0>
<tbody>
<tr><td colspan="2">My Stuff <input type="button" value=" Add " onClick="AddRow();"></td></tr>
</tbody>
</table>
</form>
</body>
</html>
I "fixed" it by turning the colspan row into 2 separate columns:
<br />
<tr><td>My Stuff</td><td><input type="button" value=" Add " onClick="AddRow();"></td></tr><br />
Any idea why the table would collapse when deleting the last row?
|
|
|
|
|
var row=x.parentNode.parentNode
row.parentNode.removeChild(row)
PopRow(this)
|
|
|
|
|
yup, that worked!
looks like I have a lot to learn... Thanks for teaching...
|
|
|
|
|
Hi,
I have Two tables in my page
Table 1 having list for checkbox with name CHK1
Table 2 also having list of checkbox with same name CHK1
using javascript i want to get the checkboxs form table 1.
|
|
|
|
|
You can get with providing id of table like
your first table id is table1
Now you can get the check box inside the table1
var ele = document.getElementById('table1').getElementByTagName('input')
for(var c=0;c < ele.length; c++){
if(ele[c].type=='checkbox'){
}
}
Please do let me know, if you have any doubt.
Please provide "Vote" if this would be helpful, and make "Accept Answer" if this would be correct answer.
Thanks,
Imdadhusen
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
modified on Thursday, October 28, 2010 9:16 AM
|
|
|
|
|
I think you'd better change one list checkbox name.
if not, you can do it like the above answer, but it's not very good, i improve it at below:
var ele = document.getElementById("table1").getElementsByTagName("input");
var size = ele.length;
var boxs = [];
var j=0;
for(var i=0;i<size;i++){
if(ele[i].type=="checkbox" and ele[i].name=="CHK1"){
boxs[j++]=ele[i];
}
}
do you like more js or web skills? just click my blog! moocr.com
|
|
|
|
|
you can use '#table1 input:[name = CHK1]' as your parameter, and it will search get the checkbox of first table only..
|
|
|
|
|
How to handle key events in Pocket Internet Explorer using javascript?
|
|
|
|
|
Does the browser in Pocket Internet Mobile support javascript? If it does, so you can using javascript as the same as on windows platform.
|
|
|
|
|
if the browser support the JavaScript, please use the event.keycode properties to identify the keypress event happened and then do your functions.
|
|
|
|
|
Hi,
While running my application if any error gets then, a modalbox will show with the error message, So I close the modalbox using "Esc" key. In the meantime the next ajax request and response is stopped in the browser since i pressed "Esc" key.
So I want to close modalbox using "Esc" and also the next ajax request and response do not stopped by the browser?.
Can anybody help me how can i handle this?
Regards,
Periyasamy.R
|
|
|
|
|
Most browsers use the Escape key to cancel out of loading a page and I think it is probably also causing any other AJAX requests being processed to also be canceled by your browser.
As for stopping this default behavior, you could try preventing the Esc key's default action with the following:
e.cancelBubble=true;
e.returnValue = false;
if (e.stopPropagation){
e.stopPropagation();
e.preventDefault();
|
|
|
|
|
Hi,
Thanks for your reply. Great!. It works for me.Now the ajax request and response is not stopped when i use "Esc" or any key. Its good.
Thanks,
Regards,
Periyasamy.R
modified on Thursday, October 28, 2010 2:22 AM
|
|
|
|
|
Are you talking about a regular javascript modal message box or a html/css/js modalbox? If it's the latter, I would call it's close function prior to stopping the event propagation in your keydown handler.
|
|
|
|
|
Hi Jules,
It works for me.
Thanks for your reply.
-Periyasamy.R
|
|
|
|
|
Hi,
I close a "Modalbox" popup using "Esc" key. In the mean time, the pop up is closing but, the ajax request and response also stopped. Can anybody help how to avoid this?.
Regards,
Periyasamy.R
modified on Tuesday, October 26, 2010 7:36 AM
|
|
|
|
|
Hi Everyone,
Is it possible to close all tabs in the browser using javascript in IE7 & Firefox. Please let me know if anyone has the code.
Thanks in Advance.
Regards,
Manowj
|
|
|
|
|
I don't think you can close tabs you didn't open through javascript (imagine the havoc that would cause, if every web page you went to closed all your other tabs).
If you did open it (using window.open()), you can close it using window.close() or self.close().
- S
50 cups of coffee and you know it's on!
Code, follow, or get out of the way.
|
|
|
|
|
Yes, you are right! javascript can not close a window without any confirm or alert if it did not open the window use window.open();
moocr.com
|
|
|
|
|
Hi,
I am running web application on Pocket IE(Ver.5.0),application contains some server controls and i have to access those controls using javascript.
I used getElementById('controlName') ... so on. but i could not acces those controls.. I searched lot on google but dint got any decent reason why this is happening.
Can anyone help in this regards.?
Thanks in advanced
Rahul C.
|
|
|
|
|
Hi All:
I have a little confusion on the use of _trackEvent()-Google Analytics.
Can I use like the following ways:
_gaq.push(['_trackEvent', 'val_1', var_1]);
_gaq.push(['_trackEvent', 'val_2', var_2]);
_gaq.push(['_trackEvent', 'val_3', var_3]);
_gaq.push(['_trackEvent', 'val_4', var_4]);
.....
...
Thanks in advanced.
|
|
|
|
|
|
I have to Find Gridview Footer Row in Javascript. Is there any chance to show/hide footer row in javascript.
How to Find Label in Footer Row.
|
|
|
|