473,626 Members | 3,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to retrieve a parameter?

I have the following function in a html file:

function selectEdit(file ID, processCode, processID, fileName,fileDe sc)
{
document.forms[0].recordID.value = fileID;
document.forms[0].processor.valu e = processCode; `
document.forms[0].processorID.va lue = processID;
document.forms[0].interfaceFileN ame.value = fileName;
document.forms[0].fileNameDesc.v alue=fileDesc;
document.forms[0].submit();
}
The function is called by many buttons in the same form.
Each button is supposed to be redirecting to different html pages
based on the parameter "document.f orms[0].recordID.value " i have
directed the form action to a jsp page to handle the redirection but i
cannot get the parameter using jsp. Can i retrieve the
"document.f orms[0].recordID.value " if so how?
Do i use javascript to retrieve? I tried using
request.getPara meter("recordID ")in my jsp but i get a null pointer
exception.
Am i retrieving the value corrrectly?

Thanks
Jul 23 '05 #1
1 4112
In article <59************ **************@ posting.google. com>, scout3014
@gmail.com enlightened us with...
I have the following function in a html file:

function selectEdit(file ID, processCode, processID, fileName,fileDe sc)
{
document.forms[0].recordID.value = fileID;
document.forms[0].processor.valu e = processCode; `
document.forms[0].processorID.va lue = processID;
document.forms[0].interfaceFileN ame.value = fileName;
document.forms[0].fileNameDesc.v alue=fileDesc;
document.forms[0].submit();
}
The function is called by many buttons in the same form.
Each button is supposed to be redirecting to different html pages
based on the parameter "document.f orms[0].recordID.value " i have
directed the form action to a jsp page to handle the redirection but i
cannot get the parameter using jsp. Can i retrieve the
"document.f orms[0].recordID.value " if so how?
Do i use javascript to retrieve? I tried using
request.getPara meter("recordID ")in my jsp but i get a null pointer
exception.
Am i retrieving the value corrrectly?


Javascript runs on the client. It has nothing at all to do with Java, despite
the name of the language.
JSP is Java Server Pages. It IS Java. (java is OT here)

Javascript cannot retrieve posted form values. It can parse a URL for GET
params.
JSP can retrieve either.

request.getPara meter will never give you a null pointer exception - it's what
you're doing afterwards that is giving you the exception. If no value exists
for the param, it returns null.
From what I can tell, request.getPara meter is getting null for recordID. That
means there is no value. Check what is actually get sent to the server. Just
out.print the values of the form params in the JSP and comment everything
else out. Did you get a value for recordID? If so, it's your JSP code that is
the issue, not your javascript.

Javascript is NOT a typed language - if you call the function wrong, it won't
complain overmuch. Not like Java. Are you SURE you're passing the right info
to the javascript function? Place some alerts in there if you're not sure.
See what you're really passing for fileID (which is then assigned to
recordID).

HTH

--
--
~kaeli~
Synonym: the word you use in place of a word you can't
spell.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
409
by: Eugfene | last post by:
i have the following function in a html file: function selectEdit(fileID, processCode, processID, fileName,fileDesc) { document.forms.recordID.value = fileID; document.forms.processor.value = processCode; ` document.forms.processorID.value = processID; document.forms.interfaceFileName.value = fileName; document.forms.fileNameDesc.value=fileDesc; document.forms.submit();
0
1271
by: Ramkumar | last post by:
Hi I am calling a DB2 stored procedure with 3 parameters. The last one is an inout parameter in which a value is returned (SQLCODE). I am using the DB2DataAdapter object's fill method to return a dataset. I am getting the results fine in the dataset. However, how can I retrieve the inout parameter's value? Any ideas From http://www.developmentnow.com/g/36_0_0_0_0_0/dotnet-languages-csharp.ht Posted via DevelopmentNow.com Group...
12
4704
by: Dica | last post by:
i can't seem to find a way to cast the value in my comboBox to integer. i've tried the following: short iProjectID = Convert.ToInt16(cboProjects.SelectedValue); i keep getting a "Sepcified cast is not allowed" error. how can i do this?
5
6666
by: bobdydd | last post by:
Hi Everybody I have an Access database that passes a Parameter to a web page something like this. http://localhost/index.htm?paramName=1234-54321 I want to be able to retrieve the parameter (In this example 1234-54321) and pass it to a text box on a form. Something like this. <form name="form1" id="form1" method="post" action="">
1
1644
by: tomjbr.32022025 | last post by:
I have started looking at the nhibernate framework, but do not really like the string based API which makes it impossible to use automatic refactoring of a property name without the risk of getting problems where the property has been refered to as a string... Therefore I am wondering if it would be even theoretically possible to improve such a framework with stronger typing, to avoid the usage of strings. For example, consider this...
0
1389
by: onno.willems | last post by:
Hi, In our project we have a large library of VB script (.vbs) files. Each file has 1 function. I want to document these functions, so a VB.NET application can retrieve the documentation and display it. I thought that the best way to do this is in XML. Since the files in the library have to remain VB script, the XML parts have to be preceded by VB script comment characters. Something in the line of this (vbscript example):
5
25551
by: Ken | last post by:
I'm trying to run a loop to capture column property information from a table in my datasource. Can anybody see where this is going wrong? Dim tbl As New DataTable Dim col As DataColumn Dim x As Integer Dim colName(99) As String Dim colType(99) As String cn.Open() tbl = cn.GetSchema("Orders") 'Orders is a table in the
3
3320
by: DhruviTrivedi | last post by:
Is there any way to get parameter value from variable like @Param1 varchar(50) @Param2 varchar(50) set Param1 ='value1' while --condition-- begin
5
9441
by: =?Utf-8?B?QXhlbCBEYWhtZW4=?= | last post by:
Hi, I've created a class library assembly containing several string resource files, like: - TableColumns.resx - TableColumns.de.resx - General.resx - General.de.resx
0
8707
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8641
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2628
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.