|
how can we split a string in java script....?
adarsh
|
|
|
|
|
|
hi....
i have a dropdownlist and listbox having same items(string)... when i select an item frm dropdownlist ,the same item(string) should be removed from the listbox......i need java script coding since its client side.......
adarsh
m_squared
|
|
|
|
|
Hi there, a whole lot of code (for once i made an example out of it). You'll see it does work!
<html><head><script language="Javascript">
function go() {
var optionCounter;
var smalllist = document.getElementById('smalllist');
var biglist = document.getElementById('biglist');
var selectedValue = smalllist.options[smalllist.selectedIndex].value;
for(optionCounter = 0; optionCounter < biglist.length; optionCounter++) {
if(biglist.options[optionCounter].value == selectedValue){
alert(biglist.options[optionCounter].text + " will be removed");
biglist.options[optionCounter] = null;
}
}
}
</script></head><body><form><table width="100%"><tr><td>
<select id="smalllist" name="smallist" onChange="go()">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">tree</option>
<option value="4">four</option>
<option value="5">five</option>
<option value="6">six</option>
<option value="7">seven</option>
<option value="8">eight</option>
<option value="9">nine</option>
<option value="10">ten</option>
</select>
</td><td>
<select multiple="multiple" size="4" id="biglist" name="biglist">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">tree</option>
<option value="4">four</option>
<option value="5">five</option>
<option value="6">six</option>
<option value="7">seven</option>
<option value="8">eight</option>
<option value="9">nine</option>
<option value="10">ten</option>
</select></td></tr></table></form></body></html>
|
|
|
|
|
Hi friends,
I tried to execute a EXE File through Struts Framework.It works fine when I compiled the java program individually through command prompt.
But it is not working when i tried in struts framework.Can u friends please provide me the solution soon.
bye
|
|
|
|
|
I have a script , running under ColdFusion 6,1,0,63958. and MySQL as Database Engine
<cfprocessingdirective pageencoding="utf-8">
<cfset setencoding("form","utf-8")="">
<cfcontent type="text/html; charset=UTF-8">
<cfif isdefined("code")="">
<cfquery datasource="db" name="InsSQL">
Insert into test_unicode SET mem='#code#'
<cfquery datasource="db" name="SelSQL">
SELECT * FROM test_unicode
<cfoutput query="SelSQL">
#ID#, #mem#
But when i try to submit Japan characters it returns :
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][MySQL][ODBC 3.51 Driver][mysqld-4.0.26-standard]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''„' at line 2
The error occurred in C:\...\unicode\index.cfm: line 10
8 : <cfquery datasource="db" name="InsSQL">
9 : Insert into test_unicode
10 : SET mem='#code#'
11 :
12 :
--------------------------------------------------------------------------------
SQL Insert into test_unicode SET mem='的最 臨的最'
DATASOURCE db
VENDORERRORCODE 1064
SQLSTATE 42000
Please try the following:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
HELP ME PLEASE , WHY ??? HOW find a solution ?
|
|
|
|
|
I'm trying to display a PDF image when a number of a details is typed in a textbox and the search button is pushed.
does any one have any ideas or help?
boldeagle
|
|
|
|
|
What are the advantages of moving from the traditional table layout style of a web page to the new CSS layout?
Any disadvantages or reasons not to move to CSS?
|
|
|
|
|
econner wrote: What are the advantages of moving from the traditional table layout style of a web page to the new CSS layout?
:: You can make pages with half the code (or less), which gives faster downloads.
:: You can separate the markup from the layout, which simplifies construction and maintanence.
:: Correct usage of html tags makes search engines index your pages better, and makes it possible for disabled persons to access your site. It also makes your page usable with any browser, ancient or future, even if they don't display it correctly.
econner wrote: Any disadvantages or reasons not to move to CSS?
Table layouts works better with browsers that partially, and inaccurately, support css, like Netscape 4 and contemporaries.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks.
I will take a closer look at CSS. Is Visual Studio 2005 Web Edition editor a good place to start? Or, are there any other editors you would suggest?
|
|
|
|
|
Visual Studio 2005 works fine to make CSS layouts.
I suggest that you use Firefox to test the designs while working. Visual Studio uses the same rendering engine as Internet Explorer for previews, and IE 6 has some rendering bugs.
---
b { font-weight: normal; }
|
|
|
|
|
Always one to look for an argument, me:
Guffa wrote: :: You can make pages with half the code (or less), which gives faster downloads.
Oh yeah? You can markup a basic header / 3-coloumn / footer page layout using HTML tables in a dozen lines of code. Try doing that in CSS! Au contraire, you can find whole websites devoted to this one signle topic. Or problem, to be more accurate. And the solutions they come up with involve a lot of code.
Guffa wrote: :: You can separate the markup from the layout, which simplifies construction and maintanence.
Oh yeah? How easy is td bgcolor=#cccccc compared to td class=fred now then where is my definition of fred, oh yeas it's in xyz.css which is in abc folder right got that now then where the hell is my fred class... somewhere down at line 533 I think...
Guffa wrote: :: Correct usage of html tags makes search engines index your pages better, and makes it possible for disabled persons to access your site. It also makes your page usable with any browser, ancient or future, even if they don't display it correctly.
OK, I'll give you that - but emphasize the words "Correct usage" - otherwise your page will look a right mess. And don't forget to write half a dozen CSS pages for all the different browsers out there....
But - and it's a big butt (no that's not a typo) - fact is CSS is the way it's going so you - and I - are just going to have to get used to it. And yes, of course I am being a bit disingenuous, because a site laid out with CSS will be much easier to make global changes to; eg, once your client decides they want to re-brand themselves and use orange throughout instead of blue, you'll be glad you used CSS. Site maintenance is easier if you've used CSS, but you need to be organised, and one trouble with CSS is it's inherent lack of internal order. USE COMMENTS EXTENSIVELY in your CSS. The very fact that your markup and your CSS are seperated means you have to keep track of what relates to what in some other way.
Like all web-technologies CSS suffers from the fact that every browser does things differently and while the guardians at W3C like to think they're the arbiters of standards (did I ever vote for them?) fact is we already had a standard - it was called HTML.
Nevermind - hey, I LOVE CSS/XHTML XXXX (Is there an arse-lick emoticon anywhere?) I use it all the time now. (Really, I do.)
Good luck
P
-- modified at 17:37 Monday 22nd May, 2006
|
|
|
|
|
Phil Uribe wrote: Oh yeah? You can markup a basic header / 3-coloumn / footer page layout using HTML tables in a dozen lines of code. Try doing that in CSS! Au contraire, you can find whole websites devoted to this one signle topic. Or problem, to be more accurate. And the solutions they come up with involve a lot of code.
That specific example may be more difficult to accomplish using floating elements, but just because there are people that are confused about it doesn't prove that it can't be done.
Phil Uribe wrote: Oh yeah? How easy is td bgcolor=#cccccc compared to td class=fred now then where is my definition of fred, oh yeas it's in xyz.css which is in abc folder right got that now then where the hell is my fred class... somewhere down at line 533 I think...
Yes, if you look at one single element and want to find out it's properties, it's easier if the properties are in the element itself. That will be very helpful when you want to change the background color of all ten thousand table cells that are scattered across a hundred web pages...
Phil Uribe wrote: And don't forget to write half a dozen CSS pages for all the different browsers out there....
Or you can use methods works in all modern browsers, and write a single CSS file. It takes a bit of learning-by-doing to get the hang of what you have to do to make it work with the quirks in IE, though.
Phil Uribe wrote: The very fact that your markup and your CSS are seperated means you have to keep track of what relates to what in some other way.
True. Descriptive naming of elements and classes play a large role in that. "#Links .Header" works much better than ".blkbldhdr".
Phil Uribe wrote: (Is there an arse-lick emoticon anywhere?)
:P3
---
b { font-weight: normal; }
|
|
|
|
|
I might be a little late, but here are some good resources (might have to dig a little):
http://www.csszengarden.com/[^]
http://www.alistapart.com/topics/code/css/[^]
I'm a huge TABLE fan, it just makes sense to me (rows and columns) . CSS can drive you nuts when you cross browsers. I like CSS, but it's just another thing you have to learn, and like every technology, once you learn all the tricks and workarounds, there will be something new to learn the tricks and workarounds of (endless loop).
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Steve Echols wrote: CSS can drive you nuts when you cross browsers.
True, but tables are far worse in that aspect. How tables are rendered are up to the specific browser to decide, so they work differently in every browser. To make tables behave the same across browsers, you have to totally defeat the default behaviour of the tables.
---
b { font-weight: normal; }
|
|
|
|
|
I've mainly tested in firefox and ie, but TABLES have always seemed to be rock solid in both browsers for dynamic layout, width=100% type stuff (although height=100% has thrown me for some loops). Even if I have to defeat the default behavior, they still work the same in both browsers.
I've ran into problems when I mix DIV with tables, specifically with IE and scrollbars when using overflow: auto.
And the debate rages on....
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Steve Echols wrote: (although height=100% has thrown me for some loops)
That is because there is no height attribute for tables. You need to use CSS to set the height of a table.
---
b { font-weight: normal; }
|
|
|
|
|
i want to create a button in html as "print".
how can i enable the printing like printing from the browser it self?
Militiaware
Faris Madi
|
|
|
|
|
<a href="JavaScript:self.print()">Print</a>
okay this is a link, transform it yourself to a button or place an image in the tag.
|
|
|
|
|
Hi.
How can I close right click on flash files, In code or in fla file itself ?
I have used flash player component.
Best wishes
|
|
|
|
|
Hi,
How can i print a praticular div region using javascript on the claick of a button.
Will it show a print dialog or will it directly print.
Thanks in advance.
Deepak Surana
|
|
|
|
|
It will always show a print dialog, i don't think it's possible to print directly to a printer. And I guess you best place the div block in a new window (pop up dialog or something) and print that page.
|
|
|
|
|
Ok thats a fair suggestion. thanks.
Can you plz tell me how to print a perticular div region when i click on the button.
|
|
|
|
|
Hi,
There is a problem with the javascript below. I cant find where the problem is.
I have to draw a rectangle by dragging the mouse. Also, when the mouse is first clicked before dragging and released after dragging, the mouse coordinates will be displayed.
I had 2 seperate scripts. One which draws the rectangle when the mouse is dragged and the other displays mouse coordinates when the mouse is clicked and released. Both can work individually but when I combine them, there is a problem. The rectangle can be drawn but the mouse coordinates are not displayed.
<script type="text/JavaScript">
var d;var posx;var posy;var initx=false;var inity=false;var click = 0;
function getMouse(obj,e){
posx=0;posy=0;
var ev=(!e)?window.event:e;//Moz:IE
if (ev.pageX){//Moz
posx=ev.pageX+window.pageXOffset;
posy=ev.pageY+window.pageYOffset;
}
else if(ev.clientX){//IE
posx=ev.clientX+document.body.scrollLeft;
posy=ev.clientY+document.body.scrollTop;
}
else{return false}//old browsers
var target = (e && e.target) || (event && event.srcElement);
if(target.id=='Canvas'){
obj.onmousedown=function(){
initx=posx; inity=posy;
d = document.createElement('div');
d.className='square'
d.style.left=initx+'px';d.style.top=inity+'px';
document.getElementsByTagName('body')[0].appendChild(d)
if(click == 0){
click = 1;
document.getElementByID('xbefore').value=posx;
document.getElementByID('ybefore').value=posy;
}
}
obj.onmouseup=function(){
if(click == 1){
click = 0;
document.getElementByID('xafter').value=posx;
document.getElementByID('yafter').value=posy;
}
initx=false;inity=false;
}
if(initx){
d.style.width=Math.abs(posx-initx)+'px';d.style.height=Math.abs(posy-inity)+'px';
d.style.left=posx-initx<0?posx+'px':initx+'px';
d.style.top=posy-inity<0?posy+'px':inity+'px';
}
}
else{return false}
}
document.onmousemove=function(event){
getMouse(document,event);
}
Before
X:
Y:
After:
X:
Y:
Could anyone help to see where the problem is?
I can post the 2 individual working scripts if needed
-- modified at 22:47 Sunday 21st May, 2006
|
|
|
|
|
Hi Friends,
As we got SiteMapPath control in ASP.NET.
Does any one know how to perform this functionality in classical ASP?
any code or link will be appriciated.
Naveed Kamboh
-- modified at 9:37 Monday 22nd May, 2006
|
|
|
|