Hi all,
I need to display a table column values using rs.next in jsp. Now i want to use these entries as links to show the hide box that contains other information corresponding to that column value. Is there any way to do this? The method which i am using displays hide box corresponding to each column value. Bur i want that it only displays hidebox for the link or column value clicked. Any solution will be appriciated.
Regards.
8 2472 Dormilich 8,658
Recognized Expert Moderator Expert
the first thing you should take in is that JSP is on the server and JavaScript is on the client (browser). i.e. JS code works on the output created by JSP.
so it would be helpful to know the HTML created from JSP.
Hey Dormilich. Thankyou for the reply. Well let me send you my code n i hope you understand the problem with it. - //js code
-
<script type="text/javascript">
-
function showHide() {
-
var ele = document.getElementById("showHideDiv");
-
if(ele.style.display == "block") {
-
ele.style.display = "none";
-
}
-
else {
-
ele.style.display = "block";
-
}
-
}
-
</script>
-
//jsp code
-
<body>
-
<%
-
try{
-
Class.forName("oracle.jdbc.OracleDriver");
-
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","swati","goyal");
-
ps1=con.prepareStatement("select * from register where status='No'");
-
rs1=ps1.executeQuery();
-
while(rs1.next()){
-
s1=rs1.getString(2);%>
-
<a href="javascript:showHide()"><% out.println(s1);%>
-
-
<div id="showHideDiv" style="display: none;">
-
<%
-
try{
-
-
ps=con.prepareStatement("select * from register where name=? and status='No'");
-
ps.setString(1, s1);
-
rs=ps.executeQuery();
-
if(rs.next()){
-
out.println(rs.getString(2));
-
out.println(rs.getString(4));
-
out.println(rs.getString(5));
-
out.println(rs.getString(6));%>
-
<form action="ALApproval.do" align="right">
-
<input type="hidden" name="h1" value="<%=rs.getString(2)%>"/>
-
<input type="hidden" name="h2" value="<%=rs.getString(6)%>"></input>
-
<input type="submit" class="buttn" onclick=""/>
-
</form>
-
-
<% }
-
-
}catch(Exception e){System.out.println(e);}
-
%>
-
</div>
-
-
<br/>
-
</a>
-
<% }
-
}catch(Exception e){System.out.println(e);}
-
%>
-
</body>
Dormilich 8,658
Recognized Expert Moderator Expert
it would be really helpful if you could post the code that you get in the browser. I am not a JSP expert to do that conversion by myself.
Sorry, what do you mean by the browser code? I just want to know how to use hide/show box efficiently.
I think you are not getting my problem :-(
Make hidebox invisible initially and make it visible only when user clicks on corresponding element.
Dormilich 8,658
Recognized Expert Moderator Expert
Sorry, what do you mean by the browser code? I just want to know how to use hide/show box efficiently.
what do you think, on what code does JavaScript work:
a) JSP sorce code
b) HTML source code
hey buy domain.. that is what i am asking how to make it visible for that particular element? rather it makes the hide box visible for each element upon clicking any one element.
javascript workd on the html code. that is why i have called showHide() in the html source code and the rest of the logic is in jsp. - <a href="javascript:showHide()">
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Eric Osman |
last post by:
Let's say I want to filter the contents of a target web page, and
present a simpler page on the screen.
For example, let's say a target web page is full of links, text, images,
forms, etc. and I want to present a simple page containing just the links.
The original page is not "mine", that is, I can't just edit it in
notepad and stick some javascript in it.
|
by: ianv2 |
last post by:
Hi
Is the following possible using Javascript ?
I would like a page to redirect to another page if the page expiry has
passed.
E.G.
If my questionnaireform.html page had an expiry date of July 31, if I
|
by: simon.wilkinson |
last post by:
Hi,
I am trying to update all Select boxes on a page dynamically using
javascript, I simple want to change the selected item in each select
box when a tick box is pressed on the page. Each Select box is named
in the same convention ie. ddl_DeliveryStatus_ and then the recordID
and contains the same options in the same order. The number of select
boxes changes every time the page is loaded as this is all built using
ASP linked to a...
|
by: ruchinagaich1 |
last post by:
Please tell me,
How do i open a hyperlink in parent page using javascript?
|
by: vunet.us |
last post by:
Can I get the name of a referral page using JavaScript? Just really
wondering...
| |
by: lakshmishri |
last post by:
hi all
can anyone answer this ??
i have developed a module which displays cricket score card and this is one of the part in a HTML page along with other modules. now this module alone must be refreshed at regular intervals without refreshing the page. this has to implemented using javascript
can anyone help me out ??
|
by: akristensen |
last post by:
I am new to this site, so be patient if I do not ask the question correctly.
Current Target Platform: Browser: MS IE, script language: Javascript (will use VBScript, but JS is preferred), External apps: MS Excel
What I need to do: From a web page using javascript, I open a new Excel application and sheet, populate some information into it. After it is populated with some information, I need to run the "Solver..." option on the data in the...
|
by: fastvarun |
last post by:
Can anybody help me how to remove url while print out of a page using javascript window.print() plz help me...........................
|
by: macca |
last post by:
Hi,
I'm developing an application that is going to be used in schools as
a teaching aid and require the ability to temporarily draw on my (as
in pages produced by my application) web page using javascript (such
as a teacher drawing a circle around part of the text or image on the
page to point it out to the students).
I'm not sure how i would do this but think it may have something to do
with the <canvashtml element?
|
by: Ashwani Sharma |
last post by:
is there any way to save a web page using javascript in cross browser
|
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: 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,...
|
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: 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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |