Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

On confirmation show textarea

Posted on 2011-10-02
5
Medium Priority
?
276 Views
Last Modified: 2012-06-21
Hello experts,

in my app , when user want to delete row in a table, s/he should enters delete remark "textarea", how i can show text area when click delete , i need friendly way to do this

Thaaaaanks  
0
Comment
Question by:Web_Admin
5 Comments
 
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 668 total points
ID: 36901885
do you mean that you want to show textarea details on delete confirmation message ?

try this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<SCRIPT language="JavaScript">
<!--
function chkdel()
{

return confirm(document.getElementById("Textarea1").value)
}
//-->
</SCRIPT>

</head>

<body>
<TEXTAREA rows=2 cols=20 ID="Textarea1" NAME="Textarea1">delete this
</TEXTAREA>
<INPUT type="button" value="delete" ID="Button1" NAME="Button1" onclick = " return chkdel()">

</body>
</html>

Open in new window

0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 36901915
function del()
{
      document.getElementById("txtarea").style.display='block';
}
  </script>
 </HEAD>

  <table>
  <tr>
  <td>
      Name
  </td>
       <td>
       <p id='txtarea' style='display:none'>
      <textarea rows='2' cols='10'></textarea>
      </p>
  </td>
    <td>
      <input type='button' value='Do_youWant_Delete' onclick='del()'>
  </td>
  </tr>
  </table>
0
 
LVL 20

Accepted Solution

by:
chaitu chaitu earned 664 total points
ID: 36901937
function del(obj)
{
	document.getElementById("txtarea").style.display='block';
	if(document.getElementById("deltext").value != "")
	{

		 var tab=document.getElementById('showTable');
		index= obj.parentNode.parentNode.rowIndex;
		tab.deleteRow(index);
	}

}
  </script>
 </HEAD>

  <table id='showTable'>
  <tr>
  <td>
	Name
  </td>
	 <td>
	 <p id='txtarea' style='display:none'>
	<textarea rows='2' cols='10' id='deltext'></textarea>
	</p>
    </td>
    <td>
	<input type='button' value='Do_youWant_Delete' onclick='del(this)'>
  </td>
  </tr>
  </table>

Open in new window

0
 
LVL 12

Assisted Solution

by:Ramkisan Jagtap
Ramkisan Jagtap earned 668 total points
ID: 36902524

 <script language="JavaScript">
<!--
        function chkdel() {

            document.getElementById("Textarea1").style.display = 'block';
            document.getElementById("btnchkDel").style.display = 'none';
            document.getElementById("btnDel").style.display = 'block';

        }

        function del() {

           //code for deleteing your item.

        }
//-->
    </script>

 </script>
 </HEAD>

  <table>
  <tr>
  <td>
      Name
  </td>
       <td>
       <textarea rows="2" cols="20" id="Textarea1"  style="display:none" name="Textarea1">
</textarea>
       </td>
    <td>
     <input type='button' id="btnchkDel" value='Do_youWant_Delete' onclick='chkdel()'>
     <input type='button'  id="btnDel" value='Delete' onclick='del()' style="display:none">
  </td>
  </tr>
  </table>
0
 

Author Closing Comment

by:Web_Admin
ID: 36904538
Thaaank you all :)
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question