Jump to content

Armed Rebel

  • Posts

  • Joined

  • Last visited

Posts posted by Armed Rebel

  1. I'm trying to change an onchange event, and I've got the code to do it and it's (almost) working, but I'm having a little problem with variables. Using this code:

    c2.onchange = function onchange(event) { replaceWord(inc1, (i - 1), r, (total - 1)) };

    The variables int1, i, r and total have all been declared in the script I'm using with the above line, the problem is that instead of setting the new function with the values those variables contain, it sets the variable's names as a literal string so "inc1" become the parameter. The code (of actually setting the new onchange function) works, as if I tried alert('hi') it would work fine.Any solutions to this?

  2. Hi, I'm working on a spelling function that, when an incorrect word is found, it creates a dropdown box with the suggestions. When you change it, it replaces the word in the post box, and the select is replaced with the user's choice. The problem I'm having is with the replacement of the select/text. The problem being I have no idea how to do it, and I've looked everywhere with the help of google.This is all I've got (ignore the id):

    var c = document.getElementById("word"+id2+"."+id1);	c.parentNode.removeChild(c);

    I had to code to add in a "text node", but that puts text in the <select> tag, so it's removed with the above code.Thanks for any help.

  3. Given the way the page is set up, I can't get around nesting the two forms.I should have mentioned, that the stuff for form 1 is actually in that table, above form 2, it's just that the submit button is in the div.But thats a good idea anyway, I might be able to simply combine the two forms.

  4. Currently, the way I have a page set up (there is no other way, unless it's possible to horizontally invert two table cells), a form needs to span across one table and div, and somewhere within, another form starts and ends.This creates no issue with Firefox, but in Internet Explorer 6, the form won't submit. I know it's not a problem with anything else as if I remove the inner form, the page submits fine.Here is a basic layout of what this page looks like HTML wise:

    <form (1)><table>   <!-- table stuff -->   <form (2)>   </form (2)>   <!-- table stuff --></table><div>   <!-- form 1 submit button --></div></form (1)>

    I'm hoping someone gets what I mean, and that they can give me a solution. Again, this works fine in FF but not IE6.

  5. I know your problem is already solved, but this may be an easier way:

    $file_name="12345.abcd";preg_match('/\.[^.]+$/', $file_name, $ext);

    So the extension there would be ".abcd" and the Preg_match would send it out as an array, so use $ext[0].

  6. Okay, I have a new problem, for whatever reason, nested [ul] tags (for indent) don't work.So if I were to put this code in:

    It would turn into:

    Instead of what it should be:


    ("_" == indent)Here is what is being searched for, followed by what is returned.


    Thanks :)

  7. The way I did it, is have it included in a function (the file is included) which cuts down a lot of code on your thread view page, thats the way I suggest doing it, so if you ever need to have it multiple place, it's very easy to edit.So, what'd you'd do is make a file, say, functions.php, and add in my code (read the thread, my original code doesn't work well).Then to call is later, you'd do

    $post_body = markup($rows2["post_text"]);

    Hope that helps. :)

  • Create New...