
|
hi,
im doing gui project on that user can enter values for that i have to use popup window.i alredy return code for that if i click edit button popup window opening and closing with in a second.plz help me on that im posting my code also.
jsp code:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="javax.xml.transform.Source"%>
<%@page import="javax.xml.transform.dom.DOMSource"%>
<%@page import="javax.xml.transform.Result"%>
<%@page import="javax.xml.transform.stream.StreamResult"%>
<%@page import="javax.xml.transform.TransformerFactory"%>
<%@page import="javax.xml.transform.Transformer"%>
<%@page import="java.io.FileWriter"%>
<%@page import="java.io.OutputStream"%>
<!--%@page import="java.io.intWriter"%-->
<%@page import="java.io.File"%>
<%@page import="java.io.BufferedWriter"%>
<%@page import="java.io.OutputStreamWriter"%>
<%@page import="java.io.FileOutputStream"%><html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>HSS-HOME</title>
<link rel="stylesheet" href="css/hssstyle.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=1.4.2"></script>
<script src="js/hss_button.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%@page import="org.w3c.dom.Document"%>
<%@page import="org.w3c.dom.NamedNodeMap"%>
<%@page import="java.io.InputStream"%>
<%@page import="javax.xml.parsers.DocumentBuilderFactory"%>
<%@page import="javax.xml.parsers.DocumentBuilder"%>
<%@page import="javax.xml.parsers.ParserConfigurationException"%>
<%@page import="org.xml.sax.SAXException"%>
<%@page import="org.w3c.dom.NodeList"%>
<%@page import="org.w3c.dom.Node"%>
<%@page import="org.w3c.dom.Element"%>
<%@page import="org.xml.sax.Attributes"%>
<%@page import="com.ansula.lte.oam.*"%>
<script type='text/javascript'>
var octet = '(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])';
var ip = '(?:' + octet + '\\.){3}' + octet;
var ipRE = new RegExp( '^' + ip + '$' );
function validate( value ) {
alert( (ipRE.test( value ) ? '' :'IN' ) + 'VALID IPADDRESS' );
}
</script>
<style type="text/css">
.TFtable{
width:100%;
border-collapse:collapse;
}
.TFtable td{
padding:7px; border:#4e95f4 0spx solid;
}
/* provide some minimal visual accomodation for IE8 and below */
.TFtable tr{
background: #D3D7E9;
}
/* Define the background color for all the ODD background rows */
.TFtable tr:nth-child(odd){
background: #D3D7E9;
}
/* Define the background color for all the EVEN background rows */
.TFtable tr:nth-child(even){
background: #fff;
}
</style>
<script type="text/javascript">
function myFunction(value)
{
oldvalue=document.getElementById(value).value;
var address=prompt("Please enterip_adress" + oldvalue + "");
if (address!=null)
{
document.getElementById("value").innerHTML=oldvalue;
}
}
</script>
<script type="text/javascript">
function enable_text(checkboxId,textElementId,tagName){
if(document.getElementById(checkboxId).checked === true)
{
oldvalue=document.getElementById(textElementId).value;
document.getElementById(textElementId).disabled = false;
document.getElementById(textElementId).style.backgroundColor = 'lightBlue';
//oldvalue=document.getElementById(textElementId).value;
//function test(){
// oValue= prompt("Enter value","");
//document.forms[0].elements[0].value = oValue;
//}
var df = prompt(" enter value ");
document.Form1.xname1.value = df;
}
else
{
document.getElementById(textElementId).disabled = true;
document.getElementById(textElementId).value = oldvalue;
document.getElementById(textElementId).style.backgroundColor = '';
}}
function AllowNumber(){
if (!form.xname116.value.match(/^[0-9]+$/) && form.xname116.value !=="")
{
form.xname116.value="";
form.xname116.focus();
alert("Please Enter only numbers in textbox");
}}
function OnButton1()
{
document.Form1.action = "hssupdate1.jsp";
// document.Form1.target = "_blank"; // Open in a new window
document.Form1.submit(); // Submit the page
return true;
}
function OnButton2()
{
document.Form1.action = "hssdefault1.jsp";
//document.Form1.target = "_blank"; // Open in a new window
document.Form1.submit(); // Submit the page
return true;
}
</script>
</head>
<body bgcolor="#fff">
<%
Document doc = null;
InputStream path = null;
try {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Getproperty property = new Getproperty();
String configfilepath = property.getProperty("HSSFilepath");
// System.out.println(configfilepath);
doc = dBuilder.parse(configfilepath);
// Normalize the DOM tree to combine all adjacent nodes
doc.getDocumentElement().normalize();
}
catch (ParserConfigurationException e)
{
e.printStackTrace();
}
catch (SAXException e)
{
e.printStackTrace();
}
/*here the root elelment we are taking acc to file is config*/
//int booksIdParam = "1";
/* declaring string for the node value to be displayed*/
String xname = null;
String xname1 = null;
String cell = null;
String cell1 = null;
String cdes = null;
String cdes1 = null;
Element libElement = null;
NodeList nodeList = doc.getElementsByTagName("config");
for(int i=0; i
NAME
|
<label title="<%=cdes1 %>">hss_name </label> |
|
<input type="text" style=" width:160px;" name="xname1" id="xname1" value="<%=xname1%>" disabled required /> |
<input type="text" style="width:160px;" name="celldef1" id="celldef1" value="<%=cell1 %>" readonly/> |
|
|
|
|
IP ADDRESS |
DEFAULT IP ADDRESS |
|
|
<label title="<%=cdes %>">hss_ip_address</label> |
|
<input type="text" style="width:160px;" name="xname" id="xname" value="<%=xname%>" disabled required önchange='validate(this.value)'/> |
<input type="text"style=" width:160px;" name="celldef" id="celldef" value="<%=cell %>" readonly/> |
|
|
<input type="button" value="Update"
önclick="OnButton1()" height="100" width="150" /> |
|
<input type="button" value="default"
önclick="OnButton2()" height="20000" width="5550"/> |
<input type="text" style="visibility: hidden"> |
| </form></body></html>
js code:
$(document).ready(function(){
$(".editForDesignElements").click(function(){
$(this).parent().find('div.popup').show();
});
});
|
|
|
|

|
Below I have the code I am working with. The if statement in the script is not working. What I want to do is catch the value of the prompt dialog box if the user clicks the cancel buttom and exit the script if that is the case. I have tried:
if (color=="null")
if (color==="null")
if (color=='null')
if (color==='null')
if (color==null)
if (color===null)
and none of them work. I can make the script work if I do:
if(color!=null) and modify the logical processing
but I am trying to make work with the equals comparison.
If I comment out the if conditional statement, it works fine.
Any help is greatly appreciated. Thank you.
<script type="text/javascript">
<!--
var color = prompt("Enter a color","Enter red, white, or blue.")
function colorTest(){
if(color === null){
break;
}
switch(color){
case "red":
alert("You have entered the color ' red '");
break;
case "white":
alert("You have entered the color ' white '");
break;
case("blue"):
alert("You have entered the color ' blue '");
break;
default:
alert("You did not enter a valid color");
}
}
</script>
modified 3 days ago.
|
|
|
|

|
That break inside the if does nothing...only jumps out of the if and continues to the switch !
You meant return I think...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|

|
Just put a breakpoint and see what the value of color is.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|

|
prompt returns a string var to check an var take if(color!=null) ... to check the value of var take if(color!='') and so on break-statement is not a member of if-statement
|
|
|
|

|
Hello
I want to write the confirmation message
For example when i fill in a form and click on the button "Add" I want to get a message "Are you sure you want to add...." and when i click ok the items should be added in the database and when i click cancel the form should remain as it was..
Please help me..
Thank u
|
|
|
|
|

|
thank u but am not using asp..
i want a simple code in javascript..
SM
|
|
|
|

|
It's very simple to extract the below sample code from that page, anyway customize it & search Google for more
OnClientClick="return confirm('Are you certain you want to delete this product?');"
thatrajaCode converters | Education Needed
No thanks, I am all stocked up. - Luc Pattyn
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
|
|
|
|

|
Hi,
I need help on consuming external WCF REST service and display the data using angular.js.
I have (url:http://localhost/service1.svc/flowers) that fetches WCF REST service which returns data in JSON format as given below:
[{"FlowerName":"Jasmine","Place":"Mysore"},{"FlowerName":"Rose","Place":"Bangalore"},{"FlowerName":"Sun flower","Place":"Belgaum"}]
I need to display the above data in a html with rows and columns respectively.
Can anyone please help me with suitable sample code?
Kind regards,
Ram
|
|
|
|