Underscore Problem
Apr 18, 2006
I have a select that must be named starting with an underscore, and i am trying to get this working with a script of which this function is a part:
function expandone(){
if (document.getElementById){
var selectedItem=document.product._verse.selectedIndex
contractall()
document.getElementById("dropmsg"+selectedItem).style.display="block"
}
This works perfectly if i remove the underscore from the select name and the
'document.product._verse.selectedIndex' line, but the select really needs that underscore for my shopping cart script.
I can work without this, but it is perfect for what i want, which is text (verses) showing when the customer scrolls through a select.
Are underscores not allowed in this context regarding the function above?
I suppose not, as it won't work with it.
I am not very profficient with javascript.
Is there a way round this so that i can leave the underscore in the select?
View 2 Replies
Dec 8, 2009
I have a string containing whitespaces, for example, "Michael Douglasemail.com". In Javascript, how can I replace the whitespace with underscore? "Michael_Douglasemail.com"
View 3 Replies
View Related
Jan 18, 2011
What I have is a file upload input (as part of a larger form) and I want to get some javascript that will replace spaces in a filename with another character, such as an underscore or dash. If possible, I would also like to be able to replace commas with an underscore or dash.
View 4 Replies
View Related
Jul 13, 2010
I need to remove a underscore(_) from a string, I am using the replace function bt it does not get removed? Does anybody know why.
here is the code
Code:
ISSUE_support = "Joe_Smith";
ISSUE_support.replace("_"," ");
View 7 Replies
View Related
Mar 11, 2010
I"m using [URL] for the line breaking of the link-names. It works wonderfull if the link is hyphenated like my-loooooooooooooooooooooooong-link-name, but ignores if it is with undescore.
How can one add a support the line breaking by underscore?
for example: my_loooooooooooooooooooooooong_link_name
will be:
my_loooooooooooooooo
oooooooong_link_name
View 1 Replies
View Related
Dec 20, 2005
Could somebody please confirm that if I change my JS expression test from:
if (!(/^[a-zA-Z0-9]*$/.test(document.form1.fred.value)))
to
if (!(/^[a-zA-Z0-9-_]*$/.test(document.form1.fred.value)))
(in other words I've added the hyphen and underscore after the 9)
then I'm allowing the hyphen and underscore as valid chars like a-z 0-9, but
nothing else.
It appears to work, but I don't know if I've screwed up the whole test
rather just the chars I want to add.
View 38 Replies
View Related
Jul 19, 2011
I have written a function for accepting name and should be atleast minimum 4 characters. It is accepting all characters including special characters. Now i want my function to accept only a-z0-9 and _(underscore),-(hyphen) and .(dot) Below is my function
[Code]...
View 24 Replies
View Related
Mar 11, 2010
I"m using [URL] for the line breaking of the link-names.It works wonderfull if the link is hyphenated like my-loooooooog-link-name, but ignores if it is with undescore.How can one add a support the line breaking by underscore?
for example: my_loooooooooooo_oooooooooooong_link_name.pdf will be: my_loooooooooooo_oooooooooooong_link_name.pdf
View 1 Replies
View Related
Dec 11, 2011
I am using the youtube chromeless player and embeding videos with loadVideoById() method problem is that videos with an id that contains an underscore or dash dont play although they play in the normal player. I also tried replacing with a hex value in querystring i.e (%5f) but that did not work I also tried loadVideoByUrl() method with several urls but still they don't load. here is my code
function switchToPlayer(ytid){
var params = { allowScriptAccess: "always"};
var atts = { id: ytid,onmouseover: "this.playVideo()",onmouseout: "this.pauseVideo()"};
swfobject.embedSWF("http://www.youtube.com/apiplayer?border=0&enablejsapi=1&playerapiid="+ytid, 'cell'+ytid, "150", "120", "8", "scripts/expressInstall.swf",null,params,atts);
}
[Code]....
View 4 Replies
View Related