我的表格是html,我想用透镜图,这样用户就可以把某些地点放在一边。 在提交表格之后,我如何找到地点?
成就
我的表格是html,我想用透镜图,这样用户就可以把某些地点放在一边。 在提交表格之后,我如何找到地点?
成就
虽然“@zerkms”给正确信息的指针,但这可能还不够。 I ve创设了一个fiddle with a working example: to help. 基本部分是:
地点 标识代码:
function placeMarker(location) {
if (marker) {
marker.setPosition(location);
} else {
marker = new google.maps.Marker({
position: location,
map: mapInstance
});
}
}
这里是用于处理提交书的《酒类法》:
$("#submitbutton").on("click", function(e) {
// Prevent normal submit action
e.preventDefault();
// Collect current latlng of marker and put in hidden form field
if (marker) {
$("#latlngfield").val(marker.getPosition().toString());
} else {
$("#latlngfield").val("not entered");
}
// Show results for debugging
submitAction();
// Uncomment this for production and remove submitAction() call
// $("#dataform").submit();
});
Here s the form I used:
<form id="dataform">
<fieldset>
<legend>Form Information</legend>
<label for="firstnamefield">First Name</label>
<input type="text" name="firstname" id="firstnamefield"><br>
<label for="lastnamefield">Last Name</label>
<input type="text" name="lastname" id="lastnamefield"><br>
<input type="reset" name="reset" value="Clear">
<input type="submit" name="submit" id="submitbutton" value="Submit Data">
<input type="hidden" name="latlng" id="latlngfield">
</fieldset>
</form>
在生产过程中不需要提交行动,我只想表明在生产价值方面发生的情况:
function submitAction() {
alert("Value of firstname is " + $("#firstnamefield").val());
alert("Value of lastname is " + $("#lastnamefield").val());
alert("Value of latlng is " + $("#latlngfield").val());
}
希望这一帮助!
I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...
<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...
I found this script online that creates a thumbnail out of a image but the thumbnail image is created with poor quality how can I improve the quality of the image. And is there a better way to create ...
如何确认来自正确来源的数字。
Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...
I wonder there is a way to post a message to a facebook business page with cURL? thanks
I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...
How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...