1

I have implemented search by map function on my web-site. The map have some divisions that are clickable and send a value to the controller.

<form name="myform" action="index.php?option=com&amp;task=seacrh_by_map" method="post">
<dd id="imgDI">
<a id="DI" href="javascript:getvalue('DI')" 
</a>
</dd>
<dd id="imgDII">
<a id="DI" href="javascript:getvalue('DII')" 
</a>
</dd>
<input type="hidden" name="my_value" value="" />    
</form>


<script language="JavaScript" type="text/javascript">
<!--
function getvalue (my_value)
{
document.myform.my_value.value = my_value;
document.myform.submit() ;
}
-->
</script>

After sending this form, the controller gives an answer (results of search) and the map returns to its original position. Is there a way to prevent that? The map should show the division that was chosen. Is there a way to send a value to controller using js without map form refresh?

1 Answer 1

0

You can use AJAX and JSON for this

AJAX = a method of retrieving resources asynchronously via HTTP using JavaScript

JSON = stands for JavaScript Object Notation

Simple Example is Here



AJAX stands for asynchronous JavaScript and XML, a scary-sounding mix of technologies, but don’t let the buzzwords scare you. Think of AJAX as a programming technique that combines several technologies. And remember, you’re in luck because jQuery simplifies AJAX for you.

Not the answer you're looking for? Browse other questions tagged or ask your own question.