can we have to use onclick function
echo elgg_view('input/submit',array(
'name' => 'click',
'value' => 'click',
));
if yes so how to use?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Rushikesh Solanki@Rushikesh
Rushikesh Solanki - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- damieneskimo@damieneskimo
damieneskimo - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Hermand Pessek@rheman
Hermand Pessek - 0 likes
You must log in to post replies.You have to use javascript.
i have use this code in owner_block.php
<script type="text/javascript" language="javascript">
function form() {
var elgg = require("elgg");
alert("Hello! I am an alert box!!");
}
</script>
<?php
echo elgg_view('input/submit',array(
'name' => 'biolosophy',
'value' => 'Biolosophy',
'onclick' => 'javascript:form()',
));
?>
Don't use inline javascript. Create a new AMD module.
Hi Ismayil. I tried it, but it seems not working in my case. I also tried according to the official doc: http://learn.elgg.org/en/2.3/guides/javascript.html, but couldn't get it working as well. Below is example of some of my code:
In Chrome console, I can see the error: `require.js:168 Uncaught Error: Mismatched anonymous define() module: function (require) {`.
Hm. Odd. Should work. The only thought is to try a different module name. Service can be a reserved word somewhere.
Hi everyone I am using the same technique and everything seems to work my javascript function is call but the require form field are not control (the form is submit without form control).
Could someone help me to know what's wrong ?
Best regard