Hi all,
I have one doubt,
can we pass a variable from javascript to servlet???
In Brief,
i am getting some values in javascript through jsp and the same values i
want in servlet. Ya i know i can get this values in servlet by using request.getPara meter("");
But thise values are dynamically generated so i dont know how many values will be. so i am planning to put some array list so that i can forward this values to servlet.
but i can't get this array which is declared in javascript!! :( so any buddy can help me how to get this dynamically generated values in servlet!!!
Thanks in Advance!! :)
7 8885
You would get an array (or values in a select) using request.getPara meterValues instead.
Hi, But if i declare a array in javascript how can i get that array in servlet???
Is there any way to declare array in javascript/html and same we can use in servlet??
You could just set the values to a hidden checkbox on the form and submit that.
Hi,
Actually i have a dynamic table, i have add button to table which will add the new row to table, i want all the table values in servlet for my further use.
i used hidden select box,and i am adding all values to hidden selectbox, but problem is that i am getting only fist value, but if i give more than 2 or 3 rows, i am not receiving all values in servlet.
But if i use hidden checkbox how can i put all values in single checkbox value??
The hidden select box approach should work as well. Post the code you used to populate the select.
Hi,
I used this code to populate the select box. - var k;
-
for(k=1; k<=lastRow; k++)
-
{
-
var newOption = new Option();
-
var x=document.getElementById('selRow'+ k).selectedIndex;
-
var y=document.getElementsByTagName("option");
-
-
alert(y[x].text+" In for loop has the index of: "+y[x].index);
-
-
newOption.text = y[x].text;
-
newOption.value = y[x].text;
-
document.table.ListBox4.options[len2] = newOption;
-
len2=len2+1;
-
-
}
But some of the values are not inserting propertly!!
acoder 16,027
Recognized Expert Moderator MVP
Line 6 (setting y) will cause problems because you're getting all the options in the document (which is increasing all the time in the loop). So put that statement outside the loop.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Stefano |
last post by:
Posted: Fri Jan 23, 2004 3:59 pm Post subject: Variable Javascript
--------------------------------------------------------------------------------
Hi all,
i have a problem with javascript variable.
I have a script that sets a global variable and open a dialog, then
when i
push a button of this dialog and i read the variable, this variable
|
by: Max |
last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong
here as I'm not able to pass a simple variable to a function.
In the head of doc I have:
<script type="text/javascript">
function radioenable(value) {
document.forms.search.elements.value.disabled=false;
|
by: Das |
last post by:
Hi all,
I'm writig an application that sends an http request to java servlet file.
I have to pass an xml file to the servlet.
How should I pass xml file to the file.
When I try to access the url directly it shows me
Forbidden
You do not have permission to access /RequestListenerServlet on this server.
|
by: Paul |
last post by:
Just wondering if someone could provide an example of passing a variable from
the code behind to javascript in vb. I want to have one control have focus
with the page loading with one condition and have another control with focus
after the page loads from a different condition. A gets set in the code
aspx.vb file and the script might look something like,
<script language="javascript">
function DoHighlight(a)
{
if a = 1 {...
|
by: JJ |
last post by:
I am using a handler (processImage.ashx) to display an image. The image is
displayed according to parameters passed in the querystring. The handerl is
called via some clientside javascript.
I want to send an array of unknown length to the handler. I am not sure
whether the querystring is the best place to do this. What's the best way to
send an array held in the client side javascript to the handler?
Thanks in advance,
JJ
| |
by: aelred |
last post by:
I have a web page where a member can open up a chat window (child window) with another member.
- From there the member can also navigate to other web pages.
- From other pages in the site, they may also open up new chat windows with other members (just not the same one).
- Each chat page is opened with the member name as the window name.
- When I log off from the web page, I would like all the chat windows to automatically close.
I...
|
by: santaji |
last post by:
I want to keep mapping of some key value pairs in javascript for that i m using a map inside javascript and want to access this map at server side in servlet where I don't know the key and value so I want to know is there anything can be done to access this var in servlet like java map where i can get both keys and corresponding values also.
var output={}
output = value1;
output = value2;
output = value3;
|
by: shabnaz |
last post by:
i have a servlet page which reads a file and stores it in a string variable.i need to display the contents of the file in a text area which that servlet creates an html in response..
how am i to do this?
pls anyone help me..
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
|
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...
| |
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |