Passing jsp variable through a link
hi everybody!!
can anyone help me? i am in great trouble. Here is my problem description....
I have one jsp page named a1.jsp in this page i have some checkbox in a form. an html link.
I select a checkbox and when i click the link then onclick() event of the link execute the javascript function and take the value of the checkbox in a variable.
I want to take the value to the page a2.jsp when i click the link.
Please help me!!
Here is my sample code............
this is the code of a1.jsp page
when i click the link named(click the link below i ) i want to go to page a2.jsp by taking the script variable a;
<script>
var a=" ";
function submitForm()
a="shakil";
</script>
<a href="a2.jsp" onClick="submitForm();">Click the link</a>_______________________________________________________
hi,
a1.jsp
<script>
var a=" ";
function submitForm()
a="shakil";
window.top.location.href ="./a2.jsp?a="+ a;
</script>
Click the linka2.jsp
hello: <%=request.getParameter ( "a" ) %>
Similar Messages
-
Passing jsp variable into javascript.....
Hai friends,
Look this code.....
var mywindow= window.open( ......)
mywindow.<%= loc%>.style.visibility = "hidden";
loc is my jsp variable passing dyanamically to the script....
But it is not taking....
when i assign jsp var into javascript like
mywindow.somehardcodedvalue.style.visibility = <%= loc%>;
it is working fine ....
pl reply me.......Hi,
It is not working.My code is like....
String loc=(String)arrStr;
%>
<script language="JavaScript" type="text/JavaScript">
mywindow.<%= loc%>.style.visibility = "hidden";
</script>
<% -
Passing FORM variables through CFSET
I am writing an account creation page for my site. After the
user inputs the required information, I would like to 1. confirm
that their email is not a duplicate of another user 2. Pass them
off to another page that allows them to confirm the information
that they input and submit the info to the database. I would like
to have the email confirmed on that page through passing the
FORM.email variable to the #CGI.SCRIPT_NAME#. If the RecordCount on
the query for duplicate email addresses comes back VALUE=0, use
CFLOCATION to pass to the next page with the FORM variables intact.
However, as forms can only have one action attribute, what is the
best way to do this, in your opinion?
Thanks so much for your help!
danuse session var to store form data:
- user submits form.
- form posts to same page (to itself).
- check for duplicate email
- if no duplicate found, copy form to a sesion var and
cflocate to next
page; if duplicate found show error to user
- on next page display user-submitted data from the session
var
make sure session vars are enabled in cf administrator and
sessionmanagement is enabled in your appliction.cfm/cfc
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/ -
Select from dual into a variable through db links
HI,I need to select value of current_timestamp in to a variable d1 of a remote database inside function.
function (db_lnk varchar2)return number
as
dbl varchar2(10);
begin
dbl:=db_lnk;
select current_timestamp into d1 from dual@dbl;
end;
but getting error table or v iew does not exist.
if i do
select current_timestamp into d1 from dual@'||dbl||';
then it says database link name expected.
How to achieve this?
ThanksPeter Gjelstrup wrote:
Foreign languages, foreign languages :-){noformat}*grins*{noformat} I know - and your English is miles better than my Danish (I'm assuming - hopefully correctly?! - that that's your 1st language based on your location!) which I don't even know any words of! *{:-) -
Passing an variable through classes on init
i have a main class
this class starts up another class
so iv got 3 classes
class1
-load class2
class2
-load class3
class3
maxslots = 0
now that maxslots variable i want to set up from the VERY first class1
but i cant see how you pass it thought the classes so its loaded when each class is started up
class class1{
private static class2 class2x= null;
public static void main(String[] args) throws IOException {
class2x= new class2(7);
}ok so my class 2 now has 7
public class class2 implements Runnable {
int maxSlots = 0;
static class3 class3x= new class3(maxSlots);
public class2(int maxSlotsx) {
maxSlots = maxSlotsx
public class class3{
int maxSlots = 0;
public class3(int maxSlotsx) {
maxSlots = maxSlotsx
System.out.println("maxSlots"+maxSlots);
}now in class 2 i CANT place the set up class3 thing within class2 constructor because its runnable and only want it done ONCE
any idea how to pass var 7 down to my end class3
thanks :)ah i worked it out lol
-
Passing Record Variable through Packages
I have a question and hope that someone can help me to find the solution.
I'm developing an application and I need to pass values form one procedure PR in package B to a function FN in package A. The why I try to go is passing the values by using a variable of record type.
I have defined in both packages the same record structure that I also use in the declarations of procedure and function. I first compiled successfully the package A but when I try to compile the package B I get a compilation error:
PLS-00306: wrong number or types of arguments in call to 'B.FN'
It looks like the parameter definition or reference gets lost.
Here below a very schematic example of my application:
create or replace package A is
type Rec1 is record
( rf1 T.f1%type,
rf2 T.f2%type,
rf3 T.f3%type)
function FN ( Par in Rec1 ) return boolean;
end;
create or replace package A is
function FN ( Par in Rec1 ) return boolean is
V_ret boolean;
begin
whatever it does
return V_ret ;
end;
end;
create or replace package B is
type Rec1 is record
( rf1 T.f1%type,
rf2 T.f2%type,
rf3 T.f3%type)
procedure PR ( Par in Rec1 ) return boolean;
end;
create or replace package B is
procedure PR ( Par in Rec1 ) is
VP Rec1;
V_go boolean;
begin
VP.rf1:= something_1;
VP.rf2:= something;
VP.rf3:= something;
V_go:=FN ( VP ); <= here the compiler complaints
whatever it does
end;
end;
Many thanks for a quick answer.Okay I didn't notice the error message text in the body of the paragraph above.
PS. If I specify singularly the fields in the parameter list I pass the compilation
but I would like to use a record variable as one.Did you see my post where I always reference the record variable in package A?
create or replace package B is
procedure PR ( Par in A.Rec1 ) return boolean;
end;
create or replace package B is
procedure PR ( Par in A.Rec1 ) is
VP A.Rec1;
V_go boolean;
begin
VP.rf1:= something_1;
VP.rf2:= something;
VP.rf3:= something;
V_go:=A.FN ( VP ); <= here the compiler complaintsIt should work. -
Accessing a packaged variable through db link
How do I access a packaged variable remotely? (Syntax)
You cannot do that:
SQL> conn xx/xx@xx
Connected.
SQL> create package p is
2 a number;
3 end;
4 /
Package created.
SQL> conn yy/yy@yy
Connected.
SQL> desc p@yy
SQL> set serveroutput on
SQL> create synonym p1 for p@xx;
Synonym created.
SQL> desc p1;
SQL> begin
2 p1.a := 1;
3 dbms_output.put_line(p.a);
4 end;
5 /
p1.a := 1;
ERROR at line 2:
ORA-06550: line 2, column 6:
PLS-00512: Implementation Restriction: 'P1.A': Cannot directly access remote package variable or cursor
ORA-06550: line 2, column 3:
PL/SQL: Statement ignoredInstead you should access these variables via functions and/or procedures. In following example I've created the private variable in package p but this doesn't matter whether it is private or public.
SQL> conn xx/xx@xx
SQL> create or replace package p is
2 procedure set_a (v in number);
3 function get_a return number;
4 end;
5 /
Package created.
SQL> ed
Wrote file afiedt.buf
1 create or replace package body p is
2 a number;
3 procedure set_a (v in number) is
4 begin
5 a := v;
6 end;
7 function get_a return number is
8 begin
9 return a;
10 end;
11* end;
SQL> /
Package body created.
SQL> conn yy/yy@yy
Connected.
SQL> set serveroutput on
SQL> desc p1
FUNCTION GET_A RETURNS NUMBER
PROCEDURE SET_A
Argument Name Type In/Out Default?
V NUMBER IN
SQL> ed
Wrote file afiedt.buf
1 begin
2 p1.set_a(1);
3 dbms_output.put_line(p1.get_a);
4* end;
SQL> /
1
PL/SQL procedure successfully completed.
Gints Plivna
http://www.gplivna.eu -
Accessing package variable through DB link
Hi,
I have ref cursor variable in remote DB package and want to refer that in another script.
v_refcur rem_package.generic_cursor_type@REMOTEDB
and accessing procedure in the remote DB
I am getting the following error
ORA-20111: ORA-02064: distributed operation not supported
ORA-06512: at "user.XXHJ_API", line 1097
ORA-06512: at line 43
any help is appreciated..Ref Cursors are not supported across databases.
Explain in more detail as to what you are trying to achieve and someone here can suggest alternatives. -
Passing 2 varibles through a URL
I don't know how to pass 2 variables through a URL. I am
familiar with ASP
but it doesn't work the same. Please help
<cflocation
url="payment.cfm?username=#FORM.username#&email="#FORM.email#"">
Wally Kolcz
Developer / SupportIt looks like you've got an extra set of quotes:
Take out the double quotes around #FORM.email#
I think that will solve the problem you are having with them
not showing up in the hidden form fields as well. -
Pass Diadem Parameters through command line
Hi,
I am trying to run DIAdem through command line. I have no problem with this but can I pass a variable through the same.
I would like to pass T1 with some value through command line. Can anyone please help me how can I do this.
Expecting your earliest reply.
Thanks,
PriyaHi Priya,
I am not quite sure what you're trying to do. So are you running a DIAdem SCRIPT from the command line? Is your variable defined within your application? How is the variable initialized when you run the script from within DIAdem. Is it a user Input? Also how exactly are your running the script from the command line?
I hope to hear from you soon and I will post as soon as I get some info from you side. Thank you for your patience.
SijinK
National Instruments -
How to pass attribute values through variables in JSP Custom TagLib
Hi,
Can anybody help me how to pass values through varuables in the jsp custom tag.
i am using JSP custom tag. I am unable to pass attribute values through variables.
<invitation:invdetails invid="<%=invid%>"/> The value is passing as <%=invid%> ,not value of the invid.
But i am getting throuh the fllowing
<invitation:invdetails invid='1' />
Please anybody suggest me how to pass value by using the variable.Hi,
It sounds like you need to set the <rtexprvalue> tag to true in the TLD for your tag. If you do this the tag will read in the value you are trying to pass to it.
dapanther... -
This test application has 3 frames.
I'm assigning a value "stuff" to a variable ("testfield1") in a javascript function ("getTest") that exists inside an html frame (testpage1.html)
Then, I click on the "test submit" hypertext link to pass the value of "testfield1" to the JSP frame (testpage2.jsp) by invoking a function ("getData") in "testpage2".
In function ("getData"), I am passing the variable "testfield1" as a parameter to the "getData" function in "testpage2".
In "testpage2" - in the ("getData" function) I try to assign the value of the variable "testfield1" to another variable called "testfld1".
Then, I try to extract the value of "testfld1" into a variable called "tstfld1" in a JSP scriptlet
....I.E. [ String tstfld1 = request.getParameter("testfld1"); ]
But, the value is apparently not passed successfully, as tstfield1 appears to be "null".
Can anyone explain what I'm doing incorrectly?
The code for this test app is below...
********testpage0 - the parent frame*********
<HTML>
<HEAD>
<TITLE>GlobalView Reports and Trending Menubar</TITLE>
</HEAD>
<FRAMESET FRAMEBORDER="0" ROWS="15%,85%">
<FRAME SRC="testpage0.html" NAME="testhtmlparent">
<FRAMESET FRAMEBORDER="0" COLS="23%,77%">
<FRAME SRC="testpage1.html" NAME="testhtml">
<FRAME SRC="testpage2.jsp" NAME="testjsp">
</FRAMESET>
</FRAMESET>
</HTML>
*******testpage1.html********
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<html>
<head><title>testpage1</title>
<link rel="stylesheet" type="text/css" href="./standard.css">
<script LANGUAGE="JavaScript">
parent.frames[2].location = "blank.html";
function getTest(reportType)
testfield1 = "stuff";
alert("testpage1.html...testfield1=" + testfield1 + ", reportType=" + reportType);
parent.frames[2].location = "testpage2.jsp";
parent.frames[2].getData(testfield1);
return;
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="reportRange">
<center>
<fieldset style="padding: 0.5em" name="customer_box">
<table cellpadding="0" cellspacing="0" border="0">
<tr class="drophead">
<td valign="top" height="0" ><span class="drophead">
test submit
</td>
</tr>
</table>
</fieldset>
</center>
</form>
</body>
</html>
*******testpage2.jsp*********
<%@ page language="java" import="java.io.*, java.util.*" errorPage="error.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<html>
<head>
<title>testpage2</title>
<script language="JavaScript">
function getData(testfield1)
alert("testpage2.jsp...testfield1=" + testfield1);
document.pageData.testfld1.value = testfield1;
document.pageData.submit();
</script>
</head>
<body>
<%
String error;
%>
<div id="HiddenForm">
<form name="pageData" method="post" action="testpage2.jsp" target="_self">
<input type="hidden" name="testfld1" value="0">
</form>
</div>
<%
String tstfld1 = request.getParameter("testfld1");
%>
<P> testfld1 = <%= tstfld1 %> </P>
</body>
</html>parent.frames[2].getData(testfield1); is in testpage1.html
so in the document.pageData.testfld1.value = testfield1; document = testpage1.html( not testpage2.html)
modifying the getData to accept the document object, and refering this object to parent.frames[2].document may help you.
good Luck .... -
How can I pass a variable to an applet in JSP?
I want to invoke an Applet in JSP and pass a variable( ie. port) to the Applet. I do as follows:
<applet code="best.Applet1.class" width=400 height=300 >
<param name=port1 value=port>
</applet>
in Applet1.java , I use getParameter("port1"),yet I got character string "port" ,not the value of port(i.e. 100).
How can I get 100 not "port"? Thanks!!!Assuming that port is a variable defined and initailized in the jsp:
<applet code="best.Applet1.class" width=400 height=300 >
<param name=port1 value=<%= port %>>
</applet> -
How to pass javascript variable to jsp function
i want to check which table header (that is <th> in html )is clicked and based on that a jsp funtion do a query in database and should show records in sorted way according to which column head is clicked.
Table is created in html.
My function is
Vector varray = workcaseid.getWorkcaseId(Long.parseLong(MasterAccountNumber),SelectedColumn);
<table border="1">
<th ><label onClick="<%SelectedColumn="workcase_id";%>">Workcase Id</label></th>
<th><label onClick="<%SelectedColumn="status_id";%>">Status</label></th>
<tr><td>etc</td></tr>
</table>im using bean for business login, following mvc model,and i think mvc is one of good design practice to use.
<jsp:useBean id="workcaseid" scope="session"class="beanFiles.SearchWorkcaseId" />
varray = workcaseid.getWorkcaseId(Long.parseLong(MasterAccountNumber),SelectedColumn);
just tell me whether it is possible to pass javascript variable to jsp variable or not.i can do it by using hidden input type,using form and submit button. -
Having an issue with passing the text of a link to a session variable.
I am having an issue with passing the text from a link to a session variable. I am adding this html as a literal for each item in the list that i have populated with a query.
List<Literal> lit = new List<Literal>();
for (int i = 0; i < posts.Count; i+=4)
Literal someLit = new Literal();
someLit.Text=
@"<div class='row'>" +
"<div class='col-md-12'>" +
"<div class='panel'>" +
" <div class='panel-body'>" +
" <!--/stories-->" +
" <div class='row'> " +
" <br>" +
"<div class='col-md-2 col-sm-3 text-center' id='javascript'> <h3>" +
" <a href='#' runat='server' onserverclick='UserProfile_Click'>" + posts[i + 3] + " </a>" +
"</h3>" +
" </div>" +
" <div class='col-md-10 col-sm-9'>" +
"<h3><a href='Thread.aspx' runat='server' onserverclick='MyFuncion_Click'> " + posts[i] + " </a></h3>" +
" <div class='row'>" +
" <div class='col-xs-9'> " +
posts[i + 1] +
" </div>" +
"<div class='col-xs-3'></div>" +
posts[i + 2] +
" </div>" +
"<br><br>" +
" </div>" +
" </div>" +
" <!--/stories-->" +
" </div>" +
" </div>" +
" </div><!--/col-12-->" +
" </div>" +
"</div>";
lit.Add(someLit);
for(int i=0; i<lit.Count; i++)
this.Controls.Add(lit[i]);
I use one of the list positions as the text for a link in two different spots. For now, lets only talk about the line:
<a href='#' runat='server' onserverclick='UserProfile_Click'>" + posts[i + 3] + " </a>
Since I am generating these controls at pageLoad, I can't make them <asp:Linkbutton>s. And since they are anchor elements, I don't have access to an onCommand attribute or onservercommand attribute.
All I want to do is access the content from inside the specific link tags that I generate on link click and set it as a session variable. That's what I would like my UserProfile_Click function to do. I cant commandargs it in like i can with a linkbutton's
OnCommnad attribute, however.
My fear is that the onserverclick attribute resolves so something else on pageLoad normally and since I am generating it the way I am similar to the way a <asp:linkButton> resolves to a generated JavaScript.
Any help?@Brunellus
For questions related to ASP.NET use the ASP.NET forum http://forums.asp.net
You should get more, better and faster answers on the other forum. Thanks, ahead of time.
Best Regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
How do I open a PDF file in Acrobat Reader?
I am having trouble opening PDF downloads. I keep getting error messages. What do I have to do?
-
BI content(info cube) available for the folowing reqired field of ISU.
Hi, I have list of fields of ISU related to DM, CS, BI, FICA. can u please tell me the respected Info cubes of BI 7.0. ISU - Required Fields 1 Account Class 2 Account Determination ID 3 Bill Quantity / Consumption 4 Billing Class
-
FF 4.01 does two things incorrectly when displaying some sites which are not replicated on Google Chrome: # 1: Some pages do not load correctly first time and the images and text are spread out vertically one by one. # 2: Where websites use inserted
-
Technical workflow with Webservices
Hi everyone. I've developed a BPM that has as outbound message, a SYNC webservice. As output, the response of the webservice. In other interfaces, using FILE adapter as outbound, if i get errors, i can view technical workflow clicking in 'PE'. With w
-
Sapscript, turn the window
Hallo, I have an sapscript, where the pages are in landscape format. In the last page, I want to display the address of the business partner on the back side of the paper, but it must be shown from up to down and not from left to the rigth, because i