473,395 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

getting the parameter value in java script

i have a one java script function disp_confirm how i can get the parameter value with this function .

code is like this

Expand|Select|Wrap|Line Numbers
  1.     <script type="text/javascript">
  2. function disp_confirm()
  3.   {
  4.  
  5.   alert('The id for the person you clicked was:'+id)
  6.  
  7.   var r=confirm("Are you sure ?")
  8.    if (r==true)
  9.     {
  10.       document.Form1.submit()
  11.       }
  12.     }
  13.  
  14.         </script>
Aug 8 '07 #1
8 2529
epots9
1,351 Expert 1GB
i have a one java script function disp_confirm how i can get the parameter value with this function .

code is like this


<script type="text/javascript">
function disp_confirm()
{

alert('The id for the person you clicked was:'+id)

var r=confirm("Are you sure ?")
if (r==true)
{
// document.write("You pressed OK!")
document.Form1.submit()
}
else
{

//document.write("You pressed Cancel!")
}
}

</script>
Hi preeti13 welcome to TSDN,

please in the future use code tags, and the question will get better responses if posted in the correct forum (javascript).

to better assist u what is this code suppose to do?
Aug 8 '07 #2
pbmods
5,821 Expert 4TB
Moved to the JavaScript forum.

Heya, Preeti. Welcome to TSDN!

Are you trying to get the value of a variable passed in the URL?

(e.g., http://site.tld/page.ext?id=65 => 'The id for the person you clicked was 65.')
Aug 8 '07 #3
hi TSDN,
this is my first time to ake a question on the web site next time i'll be careful
Aug 8 '07 #4
Hi
i am trying to get the id in the alert box
Aug 8 '07 #5
epots9
1,351 Expert 1GB
hi TSDN,
this is my first time to ake a question on the web site next time i'll be careful
don't worry everyone makes mistakes your not the first to do that.
Aug 8 '07 #6
epots9
1,351 Expert 1GB
Hi
i am trying to get the id in the alert box
the id inside the alert box is empty, becuase it wasn't declared and hasn't been assigned a value.

what should that id be? where from your html is it calling that function?
Aug 8 '07 #7
i am calling this javascript function inside the datagrid

code is like this

Expand|Select|Wrap|Line Numbers
  1.     <script type="text/javascript">
  2. function disp_confirm(Employeenominationid)
  3.   {
  4.  
  5.   alert('The id for the person you clicked was:'+EmployeeNominationid)
  6.  
  7.   var r=confirm("Are you sure ?")
  8.    if (r==true)
  9.     {
  10.     document.Form1.submit()
  11.       }
  12.   else
  13.     {
  14.  
  15.       }
  16.   }
  17.  
  18.         </script>
  19.  
  20. <asp:datagrid id="gvEmployee" Runat="server" BorderStyle="Solid" AutoGenerateColumns="false">
  21. <Columns>
  22. <asp:BoundColumn DataField="NomineeFirstName" HeaderText="Nominee First Name"></asp:BoundColumn>
  23. <asp:BoundColumn DataField="NomineeLastName" HeaderText="NomineeLastName"></asp:BoundColumn>
  24. <asp:BoundColumn DataField="NomineeDept" HeaderText="NomineeDept"></asp:BoundColumn>
  25. <asp:BoundColumn DataField="NominationCount" HeaderText="NominationCount"></asp:BoundColumn>
  26. <asp:BoundColumn DataField="EmployeeSelected" HeaderText="Employee Selected"></asp:BoundColumn>
  27. <asp:TemplateColumn HeaderText="Edit">
  28. <ItemTemplate>
  29.                             <input runat="server" type="button" id="employeenominationnid" onclick="disp_confirm()" value="Edit" name="buttongroup"> <input runat="server" type="hidden" id="employeeid"  value='<%# DataBinder.Eval(Container.DataItem,"employeeNominationId")%>' name="hidemployeeid">
  30. </ItemTemplate>
  31. </asp:TemplateColumn>
  32. </Columns>
  33. </asp:datagrid></td>
Aug 8 '07 #8
pbmods
5,821 Expert 4TB
Preeti, please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.
Aug 8 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on...
2
by: J Krugman | last post by:
I have a form with a couple of submit buttons, plus a "pseudolink" that is also supposed to submit the form; the submitted form data feeds to a CGI script. The two submit buttons have the name...
3
by: Jacques Chaurette | last post by:
Hello all , thanks in advance for any help. While looking for a solution to how to replace the grey box while an applet loads, a search of Google got me an article by Glenn s. Peffers that claims to...
4
by: Erwin Gabler | last post by:
Trying to validate a document with a reference to a DTD ("PUBLIC" identifier): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE systems-description PUBLIC "-//foo/nono" ""> .... The DTD uses...
10
by: Peter Afonin | last post by:
Hello, I have a simple client-side form that is checking the domain availability on the domain registrar's server: <FORM action="https://www.webnames.ru/scripts/RegTimeSRS.pl" method="post">...
10
by: Sean Dockery | last post by:
I have the following HTML file that I've been using for testing... <html> <head> <script type="text/javascript"> <!-- function handleWindowLoad() { var items = ; for (var i = 0; i < 11; i++)...
4
by: AshishMishra16 | last post by:
HI friends, I am using the Flex to upload files to server. I m getting all the details about the file, but I m not able to upload it to Server. Here is the code i m using for both flex & for...
4
by: Quill_Patricia | last post by:
I have a Python script which is used to load data into a database. Up to now this script has been run by customers from the Windows command prompt using "python edg_loader.pyc". Any error messages...
1
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.