|
I'll second TinyMCE. I would say they are fine, but then again I didn't work with any other so I can't compare.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
The code below is for a simple form with a listbox and two buttons that can be used to re-order the items using Javascript - the new order is then written to a hidden text input field (which is sent back to the server on postback and can be processed there.)
It works fine in Internet Explorer but not in Firefox. If anyone knows why, or has better code (I freely admit to not being an expert in javascript) I would be grateful
thanks
Fred
<HTML>
<HEAD>
<TITLE></TITLE>
<script language="javascript">
<!--
function moveup() {
var s = document.getElementById("s1");
// get select items details
var i = s.selectedIndex;
if (i<1) {return true;} // nothing to do
var n = s.options(i).value;
var t = s.options(i).text;
// get details of next item one up the list;
var i1 = i-1;
var n1 = s.options(i1).value;
var t1 = s.options(i1).text;
var l = s.length;
var a = new Array();
var b = new Array();
// var to hold new order
var o = '';
var x;
for (x=0;x<l;x++) {
a[x] = s.options(x).value;
b[x] = s.options(x).text;
}
s.options.length=0;
for (x=0;x<l;x++) {
if (x==i1) {
s.options[x] = new Option(t,n,true,true);
s.options[x+1] = new Option(t1,n1);
x++;
} else {
s.options[x] = new Option(b[x],a[x]);
}
}
for (x=0;x<l;x++) {
o += s.options(x).value+',';
}
var tx = document.getElementById("t1");
tx.value = o;
return true;
}
function movedown() {
var s = document.getElementById("s1");
var l = s.length;
// get select items details
var i = s.selectedIndex;
if (i==l-1 || i==-1) {return true;} // nothing to do
var n = s.options(i).value;
var t = s.options(i).text;
// get details of next item one down the list;
var i1 = i+1;
var n1 = s.options(i1).value;
var t1 = s.options(i1).text;
var a = new Array();
var b = new Array();
// var to hold new order
var o = '';
var x;
for (x=0;x<l;x++) {
a[x] = s.options(x).value;
b[x] = s.options(x).text;
}
s.options.length=0;
for (x=0;x<l;x++) {
if (x==i) {
s.options[x] = new Option(t1,n1);
s.options[x+1] = new Option(t,n,true,true);
x++;
} else {
s.options[x] = new Option(b[x],a[x]);
}
}
for (x=0;x<l;x++) {
o += s.options(x).value+',';
}
var tx = document.getElementById("t1");
tx.value = o;
return true;
}
// -->
</script>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<form>
<select name="s1" size="4">
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Blue">Blue</option>
<option value="Yellow">Yellow</option>
</select>
<input type="button" value="Up" onclick="moveup();">
<input type="button" value="Down" onclick="movedown();">
<br><br><br>
<input type="hidden" name="t1">
</form>
</BODY>
</HTML>
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
Standard question #2:
What error message do you get?
Open the Javascript Console in Firefox, so that you see the Javascript error messages.
---
b { font-weight: normal; }
|
|
|
|
|
There you go - I didn't even know there was such a thing as a js console in FF!
By "not working" I mean nothing happens when the buttons are clicked - in IE teh selected item moves up or down in the select box.
It says "s has no prperties" on lines 11 and 49 , which are at the start of the two functions...?
F
|
|
|
|
|
I suppose it helps if I actually give the select element an id and not just a name property! Doing this helps, but now FF says "s.options is not a function" - yes, we know, it is supposed to be referring to the options of s...
It's my bedtime. Any ideas from anyone will be greatly appreciated over breakfast!
cheers
F
|
|
|
|
|
For some strange reason IE allows parentheses when accessing a collection. Use square brackets:
var n = s.options[i].value;
---
b { font-weight: normal; }
|
|
|
|
|
yay Guffa! - I always knew you were a genius
thanks
F
|
|
|
|
|
hai,
I have two radio button and one combo box.
when change the value of the combobox. i checked the one radio button.... any one give the solution...
karthik.
|
|
|
|
|
There is no combo box in html. Do you mean a dropdown list (select element)?
You forgot to ask a question. What is it that you need help with?
---
b { font-weight: normal; }
|
|
|
|
|
Use "OnChange" Event.
Regards,
Akhilesh Yadav
|
|
|
|
|
Hi ,
Can any body tell how to create a word document which takes content from
.xsl files and has header and footer for all pages...
The front end is asp vb script......
If you fail for the first time , call it version 1.0.
|
|
|
|
|
I have a page with a couple of hiddens that im posting to another page. On the page im posting to, i want to retrieve and print out the values of these posted hidden values using javascript.
Am not sure how to obtain these values using javascript so any help/tips would be appreciated.
thanks in advance
|
|
|
|
|
'using javascript' implies 'not using a server' (for normal $_POST or Server.getPostData or similar)?
perhaps you can try <server>write(request.nameofyourpostedhidden)
but admittedly I never tried it without having access to server...
I like this new way of learning TaiChi...
|
|
|
|
|
If they're in hidden fields, you can use document.getElementById('hidFieldId').value
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Is there any way to upload file without using file upload control ?????
jagmit
|
|
|
|
|
You can use a component, like an ActiveX component or a Java applet, that does the upload.
---
b { font-weight: normal; }
|
|
|
|
|
Try paying for a web site to be hosted.
That sometimes works for me.
|
|
|
|
|
Hi All! I've a problem with displaying caption.For example I've a label(in ASP.net) showing "Please Select Class Name". When the browser window is resized the text moves down i.e Wraps & looks ugly. How to fix this?
Thanks
|
|
|
|
|
Are you using table?
Enclose your label in table row and column,
specify the width of the TD.
If you fail for the first time , call it version 1.0.
|
|
|
|
|
The above solution is correct, but instead of specifying the width of , you can write ; the lines will go on as long as there is no line break.
"The callee (server [not server application]) is not available and disappeared; all connections are invalid.
The call did not execute," said Internet Explorer, when I tried to access a deceased [window] object using JavaScript.
::..:.:..:: KiRtAN GoR ::..:.:..::
|
|
|
|
|
hi guys,
anybody knows how to get request ip address using javascript?
Thanks.
|
|
|
|
|
Try this:
<script>
window . onerror = null;
hostaddress = hostname = "(unknown)";
localhost = java . net . InetAddress . getLocalHost ();
hostaddress = localhost . getHostAddress ();
hostname = localhost . getHostName ();
</script>
<script>
document . writeln ("<p>Your IP address is <b>" + hostaddress + "</b>.</p>");
document . writeln ("<p>Your hostname is <b>" + hostname + "</b>.</p>");
</script>
|
|
|
|
|
Hello,
I need to write a web based controller that can send a hex based message via the serial port. The message out of the port is are expecific messages for the device that we built and thus, is nothing like any internet based messages. I want to create pages with controls on it that will create those messages depending on user inputs and send them out of the serial port.
I have Windows ME and Windows XP platforms. What do I need, software wise, to be able to create such a monster?
Thanks for any help that is provided,
AngeloDusty
|
|
|
|
|
AngelLDiaz wrote: What do I need, software wise, to be able to create such a monster?
For IE it sounds like you need to write an ActiveX control and embed it in the web page(s). I don't know about other browsers.
Is that what you wanted to know?
led mike
|
|
|
|
|
Mike,
Then, I can use ActiveX controls to send messages to the serial port?
Thanks for your help. I guess from the viewpoint of a stand alone PC tied to a device directly via the Serial port, this would work fine but, does the activeX control allow me to have the page at the main server and still control the PC at home via the internet?
Sorry for my lack of experience and knowledge on this area. I have done web pages in the past and was the "Webmaster" for a Corvette car club but I never got deep into all the possibilities in HTML/web.
AngelLDiaz
led mike wrote: AngelLDiaz wrote:
What do I need, software wise, to be able to create such a monster?
For IE it sounds like you need to write an ActiveX control and embed it in the web page(s). I don't know about other browsers.
Is that what you wanted to know?
led mike
AngelLDiaz
|
|
|
|