Hi All,
Just a quick one,
My code (Below) works in Internet Explorer, but not in Chrome, Safari or Mozilla Firefox. Not sure why, but would it be possible for someone to point me in the right direction?
Thanks!
Code attached;
<script language="javascript">
function formAction(flag) {
switch (flag){
case "create":
document.forms.useraction.action = "/apps/portal_admin/create_user1.php";
break;
case "modify":
document.forms.useraction.action = "/apps/portal_admin/modify_user1.php";
break;
case "copy":
document.forms.useraction.action = "/apps/portal_admin/copy_user1.php#user2";
break;
}
document.forms.useraction.submit();
}
function helloworld() {
alert("Hello World");
}
</script>
<?php
if ($authlib->auth_authobj($posting_userid,$_COOKIE['shost_app_id'],'002')>=2) {
echo "<input type=\"button\" value=\"Create User\" class=\"formButton\" name=\"create\" id=\"create\" onClick=\"formAction('create')\">\n";
echo "<input type=\"button\" value=\"Copy User\" class=\"formButton\" name=\"copy\" onClick=\"formAction('copy')\">\n";
}
if ($authlib->auth_authobj($posting_userid,$_COOKIE['shost_app_id'],'002')>=3) {
echo "<input type=\"button\" value=\"Edit User\" class=\"formButton\" name=\"modify\" onClick=\"formAction('modify')\">\n";
echo "<input type=\"button\" value=\"This button works\" class=\"formButton\" name=\"Working\" onClick=\"helloworld()\">\n";
}
?>
Everything else in my file works just fine, including my testing button - but I don't know whether my Javascript function for "formAction(flag)" works properly. (Even though it does on IE7/8/9.
Anybody have any suggestions?
Thanks!