User Profile
Collapse
-
Seeing your code I see you have used JQuery. You can get all the Inputs of type checkbox in an array and iterate it, see whether the checked attribute is true or false. For checked inputs, you can collect the ID's and show it in an alert window.Last edited by zmbd; Apr 26 '22, 12:11 AM. Reason: [Z: {RamananKalirajan: This is a very old thread- can you edit your reply to show an actual example so that your post adds a bit more to the thread?}] -
It is not a good practice to use inneHTML for getting the values. Even if you wish to use so, you can get the value like this
Code:var innerObj = innerHTMLObject; var index = innerObj.indexOf("value="); var objValue = ""; if(index>0){ index+=7; var tempStr = innerObj.substring(index,innerObj.lenght); var tempIndex = tempStr.indexOf("\""); tempIndex+=index;
Leave a comment:
-
Hi Sayantan,
You can achieve it. Whenever you are adding a row or deleting a row make a call to another function. From the first row you can add up the third column value and sum it and display it on the subtotal. The following is a sample I write here (Not checked)
Code:function doSubTotal(){ var tblObj = document.getElementById('tblPeople'); var rowLen = tblObj.rows.length; var subTotal = 0; for(var
Leave a comment:
-
RamananKalirajan replied to How to change the option of one combo box on change other combo box item?in JavascriptHi Binod Bihari,
This is a sample. I dont know how much it will be useful for you.
Code:<html> <head> <script type="text/javascript"> var district = new Array("dis1;dis11;dis111;dis1111","dis2;dis22;dis222;dis2222","dis3;dis33;dis333;dis3333"); function loadDist(ths) { //alert(ths.selectedIndex); var disSel = document.getElementById('district');
Leave a comment:
-
RamananKalirajan replied to How to detect a textarea and insert onKeyPress into that textarea using javascript?in JavascriptHi Sithu Thwin,
Check out the function "getElementsByT agName()" it will work in Mozilla and alternate code are available for IE. This method will help you in getting the "Textarea" object. Use "setAttribu te" or .onKeyPress= or add Event Key Listener for that TextArea.
Thanks and Regards
Ramanan KalirajanLeave a comment:
-
Hi azegurb,
I went through your code. Some small changes will make ur code work.
In HTML
Code:<input type="checkbox" onclick="all1(this)" value="check/uncheckall" id="box"/>
In JS,
...Leave a comment:
-
For the Questions
1) Are you using mail to in the action attribute? otherwise it will be a normal HTTP submission only.
2) You can have n no of input boxes or select boxes inside the form. That way you can add promo codes
3) Yes you can verify it in the code.
Thanks and Regards
Ramanan KalirajanLeave a comment:
-
In the HTML form tag don't specify the action url. Add a method for onsubmit in the form. In the function check the value of the text and if it equals to ur desired one set the correct url for action attribute otherwise the other url.
Sample HTML:
Code:<form id="myForm" name="myForm" method="post" onsubmit="checkThis()"> <input type="text" id="myText"
Leave a comment:
-
Hi goodamr,
Have the same name for hos checkboxes, with that u can access it easily
ex: HTML
Code:<input type="checkbox" name="chk" id="chk1" value="check1" /> <input type="checkbox" name="chk" id="chk2" value="check1" />
In JS:
Code:var chkBox = document.getElementsByName("chk");
Leave a comment:
-
Whether this HTML file is soundtest.html?
Thanks and Regards
Ramanan KalirajanLeave a comment:
-
On Submit are you reloading the same page or navigating to some other page? If you are reloading the same page means on body load use document.form.r eset() in ur code document.global _search.rese() or place this code before the </body> tag
ex:
Code:<script type="text/javascript"> document.global_search.reset(); </script> </body>
Leave a comment:
-
RamananKalirajan replied to Hi i'm creating a form(JSP) in which i have 3 combo box.generating dynamic combo boxin JavascriptYou have to use Ajax or you have to load all the values in your form when the page is loaded. After every change you have to update the Combo box alone.
Thanks and Regards
Ramanan KalirajanLeave a comment:
-
Leave a comment:
-
Glad that you fixed by yourself. Great! Keep going.
Thanks and Regards
Ramanan KalirajanLeave a comment:
-
I guess setting a hidden variable with the JS in a Form doesn't uses any language.
Ex:
HTML:
Code:<input type="hidden" name="usrName" id="usrName" />
Code:var frmElement = document.getElementById('usrName'); frmElement.value=yourArray;
Code:String str = request.getParameter('usrName').toString();
Leave a comment:
-
Either you have to use Ajax or Form submission to pass the values. Use some hidden input fields and assign the values in the text box.
Thanks and Regards
Ramanan KalirajanLeave a comment:
-
Hi,
Make that field disabled="disab led" before submitting the form. That data won't be submitted.
Thanks and Regards
Ramanan KalirajanLeave a comment:
-
Hi,
Please update ur code like the below one.
Code:var rowCount = table.rows.length; var row = table.insertRow(rowCount); row.innerHTML = content; if(window.ActiveXObject) row.innerHTML = row.innerHTML; }
Thanks and Regards
Ramanan KalirajanLeave a comment:
-
Use onsubmit in the form tag to trigger a function call before submitting a form. You can use confirm to get the input from user if you have only yes or no.
Thanks and Regards
Ramanan KalirajanLeave a comment:
No activity results to display
Show More
Leave a comment: