User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 373,915 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,764 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 11810 | Replies: 2
Reply
Join Date: Jul 2005
Posts: 3
Reputation: Soni_7 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Soni_7 Soni_7 is offline Offline
Newbie Poster

Passing paramter from javascript to jsp

  #1  
Jul 8th, 2005
Hi ,

I have a function as :
function doCheck(str1,str2)
{
top.LocalCacheLoadStatus = false;
parent.SearchFrame.location.href=str1;
g_str_Mode = str2;
alert (g_str_Mode);
}

This has str1 as the name of the jsp file and str2 is the value which i have to pass to the jsp file given in str1.How do i do that ?

Thanks & Regards
Soni
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2005
Location: Kansas City, Missouri, USA
Posts: 344
Reputation: Troy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: Passing paramter from javascript to jsp

  #2  
Jul 8th, 2005
Try this:
function doCheck(str1,str2) { 
  top.LocalCacheLoadStatus = false;
  parent.SearchFrame.location.href=str1;
  g_str_Mode = str2;
  alert (g_str_Mode);
  var url = str1+".jsp?str2="+str2;
  alert(url);
  document.location = url;
 }

If you need to pass the variable to the jsp page, and you don't need your user to ever see the output from that jsp page--that is, you want the user to stay on the current page without noticing the value was submitted, you can use a hidden iframe--and navigate it instead of your main page. You can also use an AJAX solution, but an iframe does just fine and is easier to make compatible across browsers.
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote  
Join Date: Jul 2005
Posts: 3
Reputation: Soni_7 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Soni_7 Soni_7 is offline Offline
Newbie Poster

Re: Passing paramter from javascript to jsp

  #3  
Jul 11th, 2005
Hi,
Thanks a lot. I hope it works.Let me try.

Regards,
Soni
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 5:15 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC