Safari 8 / iOS8 not saving to Database - javascript

I have a simple html Form, that should send the input with a put command to my PouchDB Database via the http adapter.
This works as it should in every browser I tried (Firefox/Chrome/Android) but not in Safari 8 or iOS8 Mobile Safari.
Even more strange, Safari doesn't give me any error.
Anyone has a suggestion?
The Code is more or less like this:
var db = new PouchDB('http://my.website.com:5984/test');
var addToDB = function(){
var fragDB = {
_id: "tags_" + tagarr + "_" + new Date().toISOString(),
question: quest,
right: right,
wrong1: wrong1,
wrong2: wrong2,
wrong3: wrong3,
source1: source1,
source2: source2,
tags: tagarr,
tagsall: alltags
}
db.put(fragDB);
};
if(send){
send.onclick = function() {
addToDB();
};
<!DOCTYPE html>
<html lang="de">
<head>
<meta name="viewport" content="width=device-width, inital-scale=1" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="style/main.css">
<link rel="stylesheet" href="style/jquery-tag-this.css?v=5">
<link rel="stylesheet" href="style/jquery-ui-1.9.2.custom.min.css">
</head>
<body>
<div class=l eft>
<title>
title
</title>
<h1>
header
</h1>
<form class="form" name="theForm" id="theForm" action="#" method="put">
<fieldset>
<textarea type="text" name="frage" id="frage" placeholder="Hier die Frage eingeben"></textarea>
</fieldset>
<fieldset>
<div>
<p class="right">
<input type="text" name="right" id="right" placeholder="Richtige Antwort" />
</p>
</div>
<div>
<p class="wrong">
<input type="text" name="wrong1" id="wrong1" placeholder="Erste Falsche Antwort" />
</p>
</div>
<div class="clear"></div>
<div>
<p class="wrong">
<input type="text" name="wrong2" id="wrong2" placeholder="Zweite Falsche Antwort" />
</p>
</div>
<div>
<p class="wrong">
<input type="text" name="wrong3" id="wrong3" placeholder="Dritte Falsche Antwort" />
</p>
</div>
</fieldset>
<fieldset>
<div>
<p class="source">
<input type="url" name="source1" id="source1" placeholder="Erste Quelle" title="Der Link muss mit 'http' beginnen ..." />
</p>
</div>
<div>
<p class="source">
<input type="url" name="source2" id="source2" placeholder="Zweite Quelle" title="Der Link muss mit 'http' beginnen ..." />
</p>
</div>
</fieldset>
<fieldset>
<input type="text" id="simple-tags" name="simple-tags">
</fieldset>
<p class="button">
<btn type="button" id="submit">Senden</btn>
</p>
</form>
</div>
<div class=r ight>
</div>
</body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="js/jquery.tagthis.js?v=5"></script>
<script src="js/pouchdb-3.3.1.min.js"></script>
<script src="js/app.js" charset="utf-8"></script>
</html>

Related

Five9 Outbound script

I am new to Five9. I want to make a Script where there is some Fields where the agents can write some text, and after pressing a button, the text from the Field will go to the List updating the current record. Is there any possibility to realize this without using any CRM or something. Like there is any API request which can do this thing?
Thank you for your help!
<html>
<head>
<title> Script </title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<style>
</style>
</head>
<body>
<div class="nav_bar">
<button onClick="toggle('target', 'replace_target','replace_target2')">Adatlap</button>
<button onClick="toggle('replace_target', 'target','replace_target2')">Sugo</button>
<button onClick="toggle('replace_target2', 'target', 'replace_target')">Script</button>
</div>
<div>
<span id="target">Test</span>
<p> This is Test</p>
</div>
<div style="display:none" class="Sugo">
<span id="replace_target">Test2</span>
</div>
<div style="display:none" class="script">
<span id="replace_target2">SCript</span>
<p> This is SCript</p>
<div class="page1">
</div>
<form action="/action_page.php">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<input type="submit" value="Submit">
</form>
</div>
<script>
function toggle(target, source, source2) {
this[target].parentNode.style.display = 'block'
this[source].parentNode.style.display = 'none'
this[source2].parentNode.style.display = 'none'
}
</script>
</body>
</html>

Inserted value disappeares after pressing submit

I want to create a form in HTML that can take the inserted Name by the user and then after pressing submit shows the corresponded value (Age) to that user. This is my code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="MyMain.css">
<script language="JavaScript">
function myFunction() {
document.getElementById('myshow').innerHTML =
document.getElementById("Name").value;
}
</script>
</head>
<body>
<div class="container">
<div>
<fieldset>
<form action="">
<div class="row">
<div form-group">
<label for="fname">Your Name: </label>
<input type="text" class="form-control" name="name" id="Name" placeholder="Jon" value="">
</div>
</div>
<div>
<input type="submit" class="button" onclick="myFunction();" value="Submit"<br/>
</div>
</div>
</form>
</fieldset>
</div>
</div>
<div class="container">
<fieldset>
<div>
<label>Age: </label>
<p><span id='myshow'></span></p>
</div>
</fieldset>
</div>
</body>
</html>
The problem is that after pressing submit the Name will be shown in the myshow span section(Age:) just
for a fraction of second and then it disappeares and url changes to localhost:5000/?Name=Jack rather than localhost:5000/the current path/?Name=Jack
You should use onSubmit on the form element to call the function and then return false.
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="MyMain.css">
<script language="JavaScript">
function myFunction() {
document.getElementById('myshow').innerHTML =
document.getElementById("Name").value;
return false;
}
</script>
</head>
<body>
<div class="container">
<div>
<fieldset>
<form action="" onSubmit="return myFunction();">
<div class="row">
<div form-group">
<label for="fname">Your Name: </label>
<input type="text" class="form-control" name="name" id="Name" placeholder="Jon" value="">
</div>
</div>
<div>
<input type="submit" class="button" value="Submit"><br/>
</div>
</div>
</form>
</fieldset>
</div>
</div>
<div class="container">
<fieldset>
<div>
<label>Age: </label>
<p><span id='myshow'></span></p>
</div>
</fieldset>
</div>
</body>
</html>
Ps: you did not close the submit tag properly
I think that you don't need submit.
If you don't need to submit, You have to change this code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="MyMain.css">
<script language="JavaScript">
function myFunction() {
document.getElementById('myshow').innerHTML =
document.getElementById("Name").value;
}
</script>
</head>
<body>
<div class="container">
<div>
<fieldset>
<div class="row">
<div form-group">
<label for="fname">Your Name: </label>
<input type="text" class="form-control" name="name" id="Name" placeholder="Jon" value="">
</div>
</div>
<div>
<input type="button" class="button" onclick="myFunction();" value="Submit"<br/>
</div>
</div>
</fieldset>
</div>
</div>
<div class="container">
<fieldset>
<div>
<label>Age: </label>
<p><span id='myshow'></span></p>
</div>
</fieldset>
</div>
</body>
</html>

Animation with semantic ui

Trying to make an animation when clicking on a button, using semantic ui, a framework.
Tried the first code listed in this link => https://semantic-ui.com/modules/transition.html
But it doesn't work
Thanks in advance !
<!DOCTYPE html>
<html>
<head>
<title>Formulaire</title>
<link rel="stylesheet" type="text/css" href="css/form.css">
<link rel="stylesheet" type="text/css" href="css/transition.css">
</head>
<body>
<div id="pContainer">
<div id="C1">
<header id="title">
<label id="titleDescription">Sign in</label>
</header>
<div id="C2">
<form id="formulaire">
<input class="textForm" name="username" type="text" placeholder="Username"></input>
<input class="textForm" name="password" type="password" placeholder="Password"></input>
Forgot password or username ?
<div class="normalDiv">
<input class="button" type="submit" value="Confirm"></input>
<input class="button" type="button" value="Cancel"></input>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript" src="js/transition.js"></script>
<script type="text/javascript" src="js/form.js"></script>
</body>
(function(){
var bouttonConfirmer = document.querySelector(".button");
bouttonConfirmer.addEventListener("click",function(event){
var objet = document.querySelector(".textForm");
objet.transition('scale');
alert("oki");
});
})();
The first problem is that semantic-ui requires jquery (see docs) so I included jquery js and semantic-ui css/js.
The second problem is that button[type=submit] will submit the form and cause a page load. So you won't be able to see the transition. I changed the type=button to prevent this.
Lastly I made your <input /> elements self closing.
$("#confirm").on("click", function() {
$('.textForm').transition('scale');
});
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/1.11.8/semantic.min.css"/>
</head>
<body>
<div id="pContainer">
<div id="C1">
<header id="title">
<label id="titleDescription">Sign in</label>
</header>
<div id="C2">
<form id="formulaire">
<input class="textForm" name="username" type="text" placeholder="Username" />
<input class="textForm" name="password" type="password" placeholder="Password" />
Forgot password or username ?
<div class="normalDiv">
<input class="button" type="button" value="Confirm" id="confirm" />
<input class="button" type="button" value="Cancel" />
</div>
</form>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/1.11.8/semantic.min.js"></script>
</body>
</html>

How to change form field names using JQuery plugin CloneYa

I know this is a very elementary question, but I am on a tight time crunch to get this project done. I am using the JQuery plugin CloneYa and after you clone the form fields I want to be able to change the form names by appending the clone count.
<!DOCTYPE html>
<html>
<head>
<title>jQuery CloneYa demo</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
</head>
<body>
<h2>Simple Cloning</h2>
<form class="form" method="get" action="panel_test_simple.html">
<div id="animate-clone">
<div class="toclone">
<p>
<input type="text" name="name" id="sname" />
<label for="name">Name</label>
</p>
<p>
<input type="text" name="email" id="semail" />
<label for="email">E-mail</label>
</p>
<p >
<input type="text" name="web" id="sweb" />
<label for="web">Website</label>
</p>
clone
delete
</div>
</div>
<p class="submit">
<input type="submit" value="Save" />
</p>
</form>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="jquery-cloneya.js"></script>
<script>
$('#animate-clone').cloneya({
limit : 5,
valueClone : false,
dataClone : true,
deepClone : true,
clonePosition : 'after',
serializeID : true,
defaultRender : false,
preserveChildCount: true
})
.on('after_clone.cloneya', function (event, toclone, newclone) {
// alert(toclone.attr('id'));
});
</script>
</body>
</html>

Wordpress template causing white/blank screens with source and navigation behind them on IE7

I've bought and installed a custom template for Wordpress and it is randomly giving white/blank pages on all areas of the site excluding the admin cp when navigating around on IE7 (works fine on Chrome). I know it's the template as it works fine with standard templates, and I'm pretty sure it's a javascript as I've disabled all the plugins to see if it was those.
Here's the site: http://www.visualisebi.com
Looking at a page with minimal code that has the issue (Admin CP login area), the only major differences I can see that are different between the new template pages and a standard template are the amount of scripts the new template calls. Here's an example:
New template source:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Visualise Business Intelligence Services › Log In</title>
<link rel='stylesheet' id='wp-admin-css' href='http://www.visualisebi.com/wp-admin/css/wp-admin.css?ver=20111208' type='text/css' media='all' />
<link rel='stylesheet' id='colors-fresh-css' href='http://www.visualisebi.com/wp-admin/css/colors-fresh.css?ver=20111206' type='text/css' media='all' />
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/themes/theme1334/js/jquery-1.6.1.min.js?ver=1.6.1'></script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/themes/theme1334/js/modernizr-2.0.js?ver=2.0'></script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/themes/theme1334/js/superfish.js?ver=1.4.8'></script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/themes/theme1334/js/jquery.prettyPhoto.js?ver=3.1.2'></script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/themes/theme1334/js/easyTooltip.js?ver=1.0'></script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/themes/theme1334/js/jquery.easing.1.3.js?ver=1.3'></script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/themes/theme1334/js/jquery.loader.js?ver=1.0'></script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-includes/js/swfobject.js?ver=2.2'></script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/themes/theme1334/js/jquery.cycle.all.js?ver=2.99'></script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/themes/theme1334/js/audiojs/audio.js?ver=1.0'></script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/themes/theme1334/js/custom.js?ver=1.0'></script>
<meta name='robots' content='noindex,nofollow' />
</head>
<body class="login">
<div id="login"><h1>Visualise Business Intelligence Services</h1>
<p class="message"> You are now logged out.<br />
</p>
<form name="loginform" id="loginform" action="http://www.visualisebi.com/wp-login.php" method="post">
<p>
<label for="user_login">Username<br />
<input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
</p>
<p>
<label for="user_pass">Password<br />
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
</p>
<p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> Remember Me</label></p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="100" />
<input type="hidden" name="redirect_to" value="http://www.visualisebi.com/wp-admin/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
<p id="nav">
Lost your password?
</p>
<script type="text/javascript">
function wp_attempt_focus(){
setTimeout( function(){ try{
d = document.getElementById('user_login');
d.focus();
d.select();
} catch(e){}
}, 200);
}
if(typeof wpOnload=='function')wpOnload();
</script>
<p id="backtoblog">← Back to Visualise Business Intelligence Services</p>
</div>
<link rel='stylesheet' id='wp-pagenavi-css' href='http://www.visualisebi.com/wp-content/plugins/wp-pagenavi/pagenavi-css.css?ver=2.70' type='text/css' media='all' />
<script type='text/javascript'>
/* <![CDATA[ */
var wpBannerizeJavascriptLocalization = {"ajaxURL":"http:\/\/www.visualisebi.com\/wp-admin\/admin-ajax.php"};
/* ]]> */
</script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/plugins/wp-bannerize/js/wpBannerizeFrontend.min.js?ver=3.0.32'></script>
<div class="clear"></div>
</body>
</html>
Standard template source:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Visualise Business Intelligence Services › Log In</title>
<link rel='stylesheet' id='wp-admin-css' href='http://www.visualisebi.com/wp-admin/css/wp-admin.css?ver=20111208' type='text/css' media='all' />
<link rel='stylesheet' id='colors-fresh-css' href='http://www.visualisebi.com/wp-admin/css/colors-fresh.css?ver=20111206' type='text/css' media='all' />
<script type='text/javascript' src='http://www.visualisebi.com/wp-includes/js/jquery/jquery.js?ver=1.7.1'></script>
<meta name='robots' content='noindex,nofollow' />
</head>
<body class="login">
<div id="login"><h1>Visualise Business Intelligence Services</h1>
<p class="message"> You are now logged out.<br />
</p>
<form name="loginform" id="loginform" action="http://www.visualisebi.com/wp-login.php" method="post">
<p>
<label for="user_login">Username<br />
<input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
</p>
<p>
<label for="user_pass">Password<br />
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
</p>
<p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> Remember Me</label></p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="100" />
<input type="hidden" name="redirect_to" value="http://www.visualisebi.com/wp-admin/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
<p id="nav">
Lost your password?
</p>
<script type="text/javascript">
function wp_attempt_focus(){
setTimeout( function(){ try{
d = document.getElementById('user_login');
d.focus();
d.select();
} catch(e){}
}, 200);
}
if(typeof wpOnload=='function')wpOnload();
</script>
<p id="backtoblog">← Back to Visualise Business Intelligence Services</p>
</div>
<link rel='stylesheet' id='wp-pagenavi-css' href='http://www.visualisebi.com/wp-content/plugins/wp-pagenavi/pagenavi-css.css?ver=2.70' type='text/css' media='all' />
<script type='text/javascript'>
/* <![CDATA[ */
var wpBannerizeJavascriptLocalization = {"ajaxURL":"http:\/\/www.visualisebi.com\/wp-admin\/admin-ajax.php"};
/* ]]> */
</script>
<script type='text/javascript' src='http://www.visualisebi.com/wp-content/plugins/wp-bannerize/js/wpBannerizeFrontend.min.js?ver=3.0.32'></script>
<div class="clear"></div>
</body>
</html>
Any help greatly appreciated.
Is the original theme properly working in IE7 ??
Have you checked the theme demo where you purchased the theme ? Is it working in IE7. If not you can ask the theme owner to fix the issue.
(Cannot comment yet and hence the answer.)

Categories

Resources