Results 1 to 2 of 2

Thread: Javascript: Help modify a bit of code plz

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2002
    Location
    Michigan
    Posts
    143

    Javascript: Help modify a bit of code plz

    Ok, I need help with modification to this code for all u good javascripters out there.

    The code below, uses combo boxes to adjust the color and text size of text. Though, it uses a javascript popup window, where u have to input the text and then it formats it. THe problem is, if u input the color, then it formats it, and then u select the font size, it GETS RID OF the color, and only uses the font size, and vice versa.


    How do i nuke this code and format it so that I input text into a text box, and then select the color and font, and it formats it correctly instead of a stupid pop up prompt.


    If you need the whole PHP script, its
    here

    If u need the javascript file its here


    PHP Code:
    if ($CONFIG['allowtags'] == 'yes') {
                echo 
    '<tr>
                    <td valign="top"><b>Message Code</b>:</td>'
    ;
                if (
    $method == 1) {
                    echo 
    '<td colspan="2">';
                } else {
                    echo 
    '<td>';
                }

                echo 
    '<input type="button" onClick="javascript: dotag(\'b\');" style="width: 25px;" value=" B ">
                        <input type="button" onClick="javascript: dotag(\'i\');" style="width: 25px;" value=" I ">
                        <input type="button" onClick="javascript: dotag(\'u\');" style="width: 25px;" value=" U ">
                        <input type="button" onClick="javascript: dolink();" value=" LINK ">
                        <input type="button" onClick="javascript: dolist();" value=" LIST ">'
    ;

                if (
    $CONFIG['allowimages'] == 'yes') {
                    echo 
    '&nbsp;<input type="button" onClick="javascript: doimg();" value = " IMAGE ">';
                }
                
                echo 
    '&nbsp;<input type="button" onClick="javascript: dotag(\'quote\');" value=" QUOTE ">
                        <br>
                        <select name="color" style="margin-top: 4px;" onChange="doadvanced(\'color\', this.value);">
                            <option value="">Font Color: </option>
                            <option value="">==============</option>
                <option value="#000088" style="color: #000088;">AP(USA) Blue (default)</option>
                            <option value="#000000" style="color: #000000;">Black</option>
                            <option value="#0000ff" style="color: #0000FF;">Blue</option>
                            <option value="#004080" style="color: #004080;">Dark Blue</option>
                            <option value="#ff0000" style="color: #FF0000;">Red</option>
                            <option value="#800000" style="color: #800000;">Dark Red</option>
                            <option value="#008000" style="color: #008000;">Green</option>
                            <option value="#FF9900" style="color: #FF9900;">Dark Orange</option>
                        </select>
                        <select name="color" style="margin-top: 4px;" onChange="doadvanced(\'size\', this.value);">
                            <option value="">Font Size: </option>
                            <option value="">============</option>
                            <option value="8">Font size 8</option>
                            <option value="10">Font size 10</option>
                            <option value="12">Font size 12</option>
                            <option value="14">Font size 14</option>
                <option value="16">Font size 16</option>
                        </select>
                    </td>
                </tr>'
    ;
            } 
    Last edited by chugger93; Jul 24th, 2003 at 11:16 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width