Jump to content

nogray

Members
  • Posts

    930
  • Joined

  • Last visited

Posts posted by nogray

  1. this is just HTML code, you need to make sure it's clean

    for example, the <body onload=\"add();\"> shouldn't be in the middle of the page, you can just take it out (I added it just in the example)


    the <div id=\"code\"> should have a close tag
    [code]
    <div id=\"code\"></div>
    [/code]

    You can put it anywhere you want (for example, before the <p>)
  2. the onclick='add()' doesn't work because you are using document.write()

    document.write will over write the whole document (including your javascript code), you will need to use innerHTML to add the HTML to a div or another element

    Here is a sample HTML and JavaScript code
    [code]
    <html>
    <head>
    <title></title>
    <script language="javascript">
    function add() {
    var i = 1;
    var txt = "<input type='checkbox' name=prot[] value='prot'> Selection of Protonation of Residues:<br>SEGID : <select name='segid'><option value='PROA'>PROA<option value='PROB'>PROB<option value='PROC'>PROC<option value='PROD'>PROD</select>";
    txt += "Residue : <select name=resi> <option value=ASP>ASP <option value=GLU>GLU <option value=LYS>LYS </select>";
    txt += "Residue Id : <input type='text' name='resid' onClick='add();'><br>";

    document.getElementById('code').innerHTML += txt;

    }
    </script>
    </head>
    <body onload="add();">
    <div id="code">

    </div>
    </body>
    </html>
    [/code]
  3. Ok, I am attaching a version without the ajax stuff, you'll notice I have names and ids for everything. This should work in any browser
    [code]
    <html>
    <head>
    <title></title>
    <script language="javascript">
    function which_sel(){
    // you can do this
    var sel = document.places.sel2;
    alert(sel);

    // or this
    var sel2 = document.getElementById('sel2');
    alert(sel2);
    }
    </script>
    </head>
    <body onload="which_sel();">

    <form id="places" name="places" name="form1" method="post" action="">
      <select name="sel1" id="sel1" onchange="javascript:sendRequest('foo')">
        <option>unnamed1</option>
        <option>unnamed2</option>
      </select>
      <select name="sel2" id="sel2" onchange="javascript:alert(this);">
        <option>unnamed1</option>
        <option>unnamed2</option>
      </select>
    </form>
    </body>
    </html>
    [/code]
  4. try to remove the "px" from the width and height. "px" should be used only in css

    [code]
    <td valign="Top" width="200" height="100"
    [/code]

    or in css
    [code]
    <td valign="Top" style="width:200px; height:100px;"
    [/code]
  5. you miss understood my comments

    If you want to use document.getElementById("sel2") the select have to have an id
    you cannot have document.places.getElementById

    If you use your same code above (the same script you posted) all you need to do is add the name to the form
    [code]
    <form id="places" name="places"............
    [/code]

    and keep the sel as is
    [code]
    var sel = document.places.sel2;
    [/code]
  6. when you use document.getElementById, the object has to have an id property
    [code]
    <select name="sel2" id="sel2".........
    [/code]

    I tried your original code, and I found out you have an id for the form, but not a name
    just add the name property to the form and it should work
    [code]
    <form id="places" name="places"............
    [/code]
  7. If you have no links to your directory /scripts/ anywhere and no one else is linking to that folder, search engines shouldn't find it.

    robots.txt was created to stop search engines from getting pages that have linked but access requires sign up or something else. Or the site owner doesn't want his page on search engines.

    Seconds, search engines only read the output of the file (so, php, asp, html, or whatever) will be the same for search engines. So, if your script files don't output anything, nothing will be spidred.
  8. I think you need a \ before the $ in your mode strings
    [code]
    23  $mode[0] = "\$maintenance = 0;";
    24  $newmode[0] = "\$maintenance = 2;";
    [/code]

    If you want to change the actual text "$maintenance" not the variable value of $maintenance

    Also, since you are not using any reg expressions, it's best to use str_replace() because it runs faster and uses less resources.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.