Onfocus Input Disabled On Safari Browser?
Mar 30, 2010
I'm fairly new to javascript and I'm having the following issue, on Safari, when the user selects the last radio button (the one that should enable an input field) it does nothing and the input field doesn't get available for typing.
Can I please ask your help, here is the relevant code:[URl]..And here is the attached js file for this document:
Code JavaScript:
function activaInput()
{
document.candidaturaOnline.txtOutro.disabled=false;
}
function desactivaInput()
[Code]...
View 13 Replies
ADVERTISEMENT
Oct 29, 2011
I'm using a nice little script which replaces the usual file upload input with whatever image you want and then with JS makes sure that an invisible 'browse' button is underneath the mouse pointer whenever the mouse is moved over the image you want to use.
It works on every browser ie7 ie8 ie9 FF safari chrome but not on opera. On Opera the regular file input appears.
I've had a good hoke round the 'net and I know there's loads of scripts which do similar things. But either they are too complicated for me to figure out how to use them eg uploadify (bit of a newbie) or they do similar things but just not as well - like making the custom image the same size as the file input would be (there's issues with that too).
Here's the script I'm using - there's not much to it
How come it doesn't work in Opera grrrr... Is there anyway to fix it? This is perfect for what I want apart from not working in Opera.
View 3 Replies
View Related
Apr 14, 2011
I have a form that is shown depending on some criteria. If the criteria are met, I use innerHTML to swap it in. When a button is pressed, the info on the form is checked with javascript - if it passes the check I use innerHTML again to change the button to '...'.
This works fine on Firefox and Safari - the problem is that it doesn't work when I test it with my iPad (iOS 4.3). The button stays the exact same and the javascript seems to stall on the line where I execute the innerHTML. Up to this point, innerHTML on mobile Safari seemed to work the exact same way as MacOS Safari. On my iPad, the innerHTML swaps out this button if the event is triggered from a different button, but not from id="submitbutton" itself.I tested another method - disabling the button. Same issue - works on MacOS Safari/Firefox but not on mobile Safari on my iPad when using onClick from itself.
code snippets
Form (it is a string since using innerHTML=)
...form content...
<div id="submitarea" class="center">
[code]...
View 1 Replies
View Related
Aug 12, 2009
This has me completely stumped. I have a multiple select form element in my HTML document that needs to be manipulated by two different sets of context-sensitive controls. One set of controls is marked up as follows:
<div id="divControls1" name="divControls1" style="display:none">
<form id="fControls1" name="fControls1">
<input type="button" id="btnAdd" name="btnAdd" value="Add" onClick="addStuff();" />
<input type="button" id="btnEdit" name="btnEdit" value="Edit" onClick="editStuff();" disabled />
<input type="button" id="btnDelete" name="btnDelete" value="Delete" onClick="deleteStuff();" disabled />
</form>
</div>
When I load this page into Safari (on Mac OS X) and set the style of divControls1 to "display:block," I have an enabled "Add" button, a disabled "Edit" button, and a disabled "Delete" button, just as I expected. (I monitor selections in a multiple selection element to turn the buttons on and off.) But when I load this page into Firefox (also Mac OS X), all three buttons are disabled at startup. My page runs a function called startup() when the body fires onLoad. To try to troubleshoot the problem, I wrote this line at the beginning of the startup() function:
function startup() {
alert (document.getElementById("btnAdd").disabled);
...
When I run this code in Safari, the alert returns "false" (not disabled), just as I would expect, and intended. However, the same code in Firefox (Mac OS X) returns "true" (disabled) ... but the same code in Firefox (WinXP) returns "false"!
View 1 Replies
View Related
Sep 22, 2005
I've got a default value of some text in an input element when a page loads.
What I'd like to do is have the value disappear when the user clicks in the
input field.
I've figured out I can use:
onclick="this.value=''"
This works fine, however if for some reason the user adds his own input,
then click somewhere else/clicks back, the text has once again been erased.
So I thought of a function like the following, however it does not work:
function removeinput(x) {
if (x == 'Enter items not on standard list here...') {
x = ''
}
}
onclick="removeinput(this.value);"
I've also tried placing this.value inside of single quotes to no avail.
View 5 Replies
View Related
Dec 4, 2010
I want to have a function on an event
<span id= "nameheader"> </span>
<form method ="post" action="send.php">
<input
id = "nameinput"
class = "input"
value = "name"
onfocus = "focus();"
onblur = "blur();"
/>
That is when you focus on the input box the value ' name' gets put above the box and when you focus on something else it goes back to the box.
this is my function
focus(){
document.getElementById('nameheader').innerHTML = 'name';
document.getElementById('nameinput').value = '';
}
And I would obviously do the opposite for onblur event.
View 3 Replies
View Related
May 31, 2010
I need a script that will redirect to a specific page is the browser is safari version 4. if the browser is NOT safari 4 I want the browser to stay on the current page.
View 3 Replies
View Related
Jul 9, 2009
I'm using JQuery in site I'm building and I can see that it works on my browser and a majority of other peoples browsers. However, there are a couple of users for whom the features that make use of jQuery don't work. Unfortunately, these users are remote so it makes troubleshooting difficult. Is there a quick way to check if the browser (Internet Explorer)
View 1 Replies
View Related
Mar 31, 2006
Is it possible to find if user has disabled images in his/her browser settings.. well currently i want code for firefox...
View 2 Replies
View Related
Feb 3, 2010
when the following code is used in my JSP page:
$('#myForm').bind('submit', function() {
$('#submit').attr('disabled', 'disabled');
});
it disables the submit button when my form is submitted (IDs are used). This action displays a result page. If the browser's Back button is pressed to change some of entered items, the submit button in Firefox is still disabled, while the same action in MSIE8 enables it again. I don't know if this is exactly JavaScript/browser/chache issue, how to get the submit button enabled 'automatically' Unfortunately the refresh button in Firefox doesn't help either (probably JSP issue) - I have to press Enter on the address bar which is not very obvious for every user.
View 1 Replies
View Related
Apr 1, 2010
I´m trying to select all input button elements with class="button" in a page in order to change their css class. Looking through some examples I managed to come up with the code below, which works perfectly in Firefox 3.6, but for some reason seem to not work on IE7.
$('input.button[disabled=disabled]').attr('class', 'buttonDes'); how i´t could be achieved?
View 1 Replies
View Related
Feb 15, 2010
I want to fill input fields with the color grey when it's disabled. Attached find the script I'm using.
View 7 Replies
View Related
Jul 21, 2005
I am simply trying to set a field value on a form.
e.g. document.form1.stockLevel.value = 99;
This works on all browsers PC & Mac, with the exception of Safari browser on a MAC.
Tried all alternatives:
document.all.stockLevel.value = 99;
document.forms['form1'].stocklevel.value = 99;
.......etc etc
None of these work on the damn safari browser.
Anyone any ideas?
View 1 Replies
View Related
Jul 20, 2005
I have some very strange problem on the Mac (OS-X) with the Safari
browser 1.0 (v85). Some information in my form was not filled in...
after I turned on debugging and checked the console it displayed some
error messages.
The messages displayed were like:
(event handler): value undefined (result of expression trim) is not
object. Cannot be called.
I have no idea what this means!!! Does anyone know where to find the
solution for this problem? The page works fine on Windows with IE (and
probably some more browsers).
The trim function is located in an exteral javascript file which is
referenced in the head of the html. Code:
View 1 Replies
View Related
Jul 23, 2005
I would like to disable the ability of the user hold control and click
and get the dropdown menu. I am ultimately discouraging users from
easily getting a copy of the image. I was able to do this and disable
dragging on all browsers I have tested except Safari (Mac).
Code:
View 5 Replies
View Related
Oct 2, 2009
I've got this code that needs to load a .wmv file - the client is adamant about using .wmv files and not Flash files - and the client insists that it use variables for the width and height parameters.I've now got the code working correctly in IE (it's always worked in Firefox) but I've just noticed that it's not working in Safari. I'm sure it's got something to do with the <object> but am not sure how to fix it.I've tried including the safari object code for wmv files and then using an if/else statement to only load the object code for safari but my javascript skills aren't that great.As it stands right now, both Firefox and IE try to load the quicktime object after they load the wmv movie object.
View 5 Replies
View Related
Jul 23, 2010
I am working on this page - [URL]. When you click the Filter By buttons it alters the content of the iframe below it. This works fine in ALL browsers. However, when you click the browser "back" button it should return to the previous clicked Filter By button (and therefore the previous clicked iframe content). This works fine in every browser except Safari. In Safari it just returns to the previous full page (for instance, if I was viewing google before I went to my page and clicked the iframe buttons, it returns to google rather than the previous iframes).
View 8 Replies
View Related
Mar 24, 2009
Here is what I am currently using for a script:
<script>
function detectBrowser()
{
var browser=navigator.appName;
var navindex=navigator.userAgent.indexOf('Safari');
if (navindex != -1 || browser=='Safari') {alert("The Apple Safari browser does not calculate correctly.)"}
</script>
And for this to work when the page loads, I use:
<body onload="detectBrowser()";>
Basically, I have received Emails from people stating that my website calculators are off by a factor of 100 for anyone using the Apple Safari browser. Since, my website calculates correctly in Internet Explorer, Netscape, Mozilla Firefox, Opera and Google Chrome, I feel this is an Apple Safari problem. Anyway, the above code seems to work okay, but it generates the pop-up when people are using Google Chrome. Is there any way that the script can be changed so that it only pops up when loading Apple Safari?
View 8 Replies
View Related
Aug 27, 2010
I have imported css and link to my page. It works fine for all other browsers except Safari browser. When I am loading the page in Safari4 all the page content loads without style. My CSS hosted in CDN.
View 1 Replies
View Related
Nov 19, 2010
I was reading various articles on browser detection with javascript and I know it can be unreliable and unprofessional at times, but I was just playing it to see if I could get something working. What I wanted to do was attach a stylesheet if the browser in safari.
With what I remember from the articles I read, isn't there a function that is navigator.appName(); ? I have written it in sorta of pseudo-code below:
Essentially,
if(browserName=="safari"){
<link type="text/stylesheet" href="safariStyling.css"/>
}else{
<link type="text/stylesheet" href="defaultStyling.css"/>
}
I know that there is a .html() jQuery function where I can write html in the head of the document like so, head.html (HTML GOES HERE); but I have heard and form experience that mixing javascript and jQuery function can be dangerous. I would detect if the browser is safari and then link a stylesheet if true?
View 13 Replies
View Related
Jul 6, 2010
I am getting differences in the rendering between Safari and Firefox. I've tried to come up with a JS script to sort them out but I am not having much luck. Safari always produces "red", the same as FF or nothing at all (where I substitute 'vendor' for 'userAgent', etc). Here's my little test program to isolate the basic code:
<link href="testcss/ff.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" >
window.onload=detectbrowser;
function detectbrowser()
{
var browser_type=navigator.userAgent;
alert("the user agent is:" + browser_type);
var browser_type=navigator.userAgent.indexOf("AppleWebKit");
if(browser_type != -1)
{
document.write('<link rel="stylesheet" href="testcss/saf.css" type="text/css" >');
}else{
alert("no useragent verified");
}}
</script>
<!--[if lte IE 7]>
<link type="text/css" rel="stylesheet" href="testcss/ie.css" />
<![endif]-->
<title>Untitled Document</title>
</head>
<body>
<div id="testbox"></div><br />
<ul>
<li>Red is for Firefox</li>
<li>Green is for Internet Explorer</li>
<li>Yellow is for Safari</li>
</ul>
</body>
</html>
What's even odder, Safari won't even execute the ....else part of the if statement when I'm trying to detect using 'userAgent'.
View 5 Replies
View Related
Jun 29, 2010
Not what i would like but the client wants the browser re-sized on the site loading/refreshing... Been using the following and it works fine.... apart from in Safari. how i can get it working in Safari, or no chance?
Code JavaScript:
$(document).ready(function() {
window.resizeTo(1152, 866);
});
View 6 Replies
View Related
May 15, 2009
I have a web app which allows users to select multiple items from a select tag. I then call a JS function on submit which collects all the options they've selected and then adds them to the value attribute of a hidden input. The options selected are then used at a later time. This works fine on IE and Firefox, but both Chrome and Safari for not adding the selected values to the value attribute of the hidden input. Are there any JS issues for Chrome and Safari that could be responsible for this?
View 2 Replies
View Related
Jan 24, 2011
How do I tell my password function to have input type="password" onfocus. I also want the text "Password" to disappear onfocus.
[Code]...
View 8 Replies
View Related
May 23, 2011
I have to change text input type to password input type and i am using jquery script. This script work for FF, Chrome and Safari browser but not worked on ie7, ie8.
Script is as:-
How can i update my script, so that it works cross the browser.
View 1 Replies
View Related
Jul 20, 2005
I have a CGI that logs into a a secure site of mine. Basically, all the CGI
does is send the username and password I have set up, and then the normal
page opens in my brower. But, I would rather send this HTML to a file, parse
it, and spit out a different page depending on the user that's logged in.
The problem is that once the username/password gets passed to the web
server, it opens to a new page, the default page. How can I get the HTML
from that page without it opening in the browser?
View 1 Replies
View Related