Punit Shrestha

Greenhorn
+ Follow
since Nov 26, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Punit Shrestha

I have created a form and with the submit button I can enter the numeric data but I also want to add another function to it which would be run when I click the same button. I would like to ask if there is any way I can wrap up the query function in the same submit button and run it. Thanking you in advance.

I have written a simple javascript program which asks the user to enter the bounding box co-ordinates and with these co-ordinates the wfs function of getfeature needs to be run but I am getting an error message
"Bounding box coordinate is not parsable:ULX". I have no idea what this means. Here is the script:
<html>
<head>
<script>
function query() {
var ULX=document.getElementById('num1');
var ULY=document.getElementById('num2');
var LWX=document.getElementById('num3');
var LWY=document.getElementById('num4');
window.location.assign("http://localhost:8080/geoserver/wfs?VERSION=1.1.0&REQUEST=GetFeature&SERVICE=WFS&TYPENAME=tasmania_state_boundaries&crs=EPSG:4326&BoundingBox=ULX,ULY,LWX,LWY")
}
</script>
</head>
<p> Bounding Box </p>
<form>
Upper Left X Co-ordinate: <input type="text" onchange="if (/^\.?$/.test(this.value) || !/^-?\d*\.?\d*$/.test(this.value)) {alert('This field requires a Number'); this.value=''; this.focus()}" id="num1">
Upper Left Y Co-ordinate: <input type="text" onchange="if (/^\.?$/.test(this.value) || !/^-?\d*\.?\d*$/.test(this.value)) {alert('This field requires a Number'); this.value=''; this.focus()}" id="num2"><br/>
Lower Right X Co-ordinate: <input type="text" onchange="if (/^\.?$/.test(this.value) || !/^-?\d*\.?\d*$/.test(this.value)) {alert('This field requires a Number'); this.value=''; this.focus()}" id="num3">
Lower Right Y Co-ordinate: <input type="text" onchange="if (/^\.?$/.test(this.value) || !/^-?\d*\.?\d*$/.test(this.value)) {alert('This field requires a Number'); this.value=''; this.focus()}" id="num4"><br/>
<input type="button" name="Query" value="Query" onclick="query()">
</form>
</html>
11 years ago
Hello everyone,

I am new in this field of programming field and am stuck in this simple problem. I have made a simple form with the function to take input as numbers only. however, it only takes positive numbers as input but does not cater negative values. I have used the function from one of the posts. Also I need to use the data input by user as the input value in another function query () but do not have idea about how to do it. If someone could help me in this matter, please help. Thanking you in advance..

<html>
<head>
<script>
function query() {
window.location.assign("http://localhost:8080/geoserver/wfs?VERSION=1.1.0&REQUEST=GetFeature&SERVICE=WFS&TYPENAME=tasmania_state_boundaries&crs=EPSG:4326&BBOX=UX.val,UY.val,LX.val,LY.val")
}
</script>
</head>
<body>
<script>
function validate(evt) {
var theEvent = evt || window.event;
var key = theEvent.keyCode || theEvent.which;
key = String.fromCharCode( key );
var regex = /[0-9]|\./;
if( !regex.test(key) ) {
theEvent.returnValue = false;
if(theEvent.preventDefault) theEvent.preventDefault();
}
}
</script>
<p> Bounding Box </p>
<form>
Upper Left X Co-ordinate: <input type="text" onkeypress="validate(event)" name="UX"/>
Upper Left Y Co-ordinate: <input type="text" onkeypress="validate(event)" name="UY"><br/>
Lower Right X Co-ordinate: <input type="text" onkeypress="validate(event)" name="LX">
Lower Right Y Co-ordinate: <input type="text" onkeypress="validate(event)" name="LY"><br/>
<input type="button" name="Query" value="Query" onclick="query()">
</form>
</html>