如何使用Dream Weaver进行与此类似的操作?

时间:2019-05-03 20:35:38

标签: javascript php html dreamweaver

我想制作一个表单生成器,类似于此处的页面:http://klmcit.nl/web/apply如果可能,我想使用DreamWeaver生成它。 如果您不介意,请提供教程。

我尝试添加一些字段,但是我不知道如何从字段中获取输入内容,并将该输入内容放到文本区域中,从而使输入内容位于文本之间。

我设法编写了代码,但是我想在Dream Weaver中编写代码,这是代码:

function generateCode2() {
        var AccoutName = document.forms["TRF"]["accname"].value;
    	var IngameName = document.forms["TRF"]["iname"].value;
    	var MtaSerial  = document.forms["TRF"]["mtaserial"].value;
    	var Nationality = document.forms["TRF"]["nationality"].value;
    	var ageNgender = document.forms["TRF"]["gender"].value;
    	var AboutY = document.forms["TRF"]["aboutyourself"].value;
    	var PlayTime = document.forms["TRF"]["playt"].value;
    	var TimeZone = document.forms["TRF"]["YTZ"].value;
    	var EnglishS = document.forms["TRF"]["englishskills"].value;
    	var WhyJoinIM = document.forms["TRF"]["joinIM"].value;
    	var WhyAcceptIM = document.forms["TRF"]["whyaccept"].value;
    	var PGroups = document.forms["TRF"]["prevgroups"].value;
    	var FriendsF = document.forms["TRF"]["friendsf"].value;
    	var StatsL = document.forms["TRF"]["StatsLink"].value;
    	var MyHistory = document.forms["TRF"]["historyS"].value;
    	var Soi1G = document.forms["TRF"]["soi1"].value;
    	var Soi2G = document.forms["TRF"]["soi2"].value;
    	var Soi3G = document.forms["TRF"]["soi3"].value;
    	var Soi4G = document.forms["TRF"]["soi4"].value;
    
    
        document.getElementById("box").value = "[center][img width=500 height=500]https://i.imgur.com/FuxDfcy.png[/img][/center]"+
    "[hr]"+
    "\n"+
    "[table]"+
    "\n"+
    "[tr]"+
    "\n"+
    "[img]https://i.imgur.com/vcPYGyc.png[/img]"+
    "\n"+
    "[b][i]Your Account Name:[/i][/b] "+AccoutName+
    "\n"+
    "[b][i]Your In-Game Name:[/i][/b] "+IngameName+
    "\n"+
    "[b][i]Your Serial (F8 > serial):[/i][/b] "+MtaSerial+
    "\n"+
    "[b][i]Nationality:[/i][/b] "+Nationality+
    "\n"+
    "[b][i]Age and Gender:[/i][/b] "+ageNgender+
    "\n"+
    "[b][i]Tell us about yourself (At least 25 words):[/i][/b] "+AboutY+
    "\n"+
    "\n"+
    "\n"+
    "[img]https://i.imgur.com/FJDfOzm.png[/img]"+
    "\n"+
    "[b][i]Average weekly playtime:[/i][/b] "+PlayTime+
    "\n"+
    "[b][i]Your Time zone:[/i][/b] "+TimeZone+
    "\n"+
    "[b][i]English skills (1-10):[/i][/b] "+EnglishS+
    "\n"+
    "[b][i]Why do you want to join Imperials? (minimum 50 words):[/i][/b] "+WhyJoinIM+
    "\n"+
    "[b][i]Why should we accept you? (30 Words):[/i][/b] "+WhyAcceptIM+
    "\n"+
    "[b][i]Your previous groups, your rank in each and reason for leaving them:[/i][/b] "+PGroups+
    "\n"+
    "[b][i]Do you have any friends in the family? Tell us their names:[/i][/b] "+FriendsF+
    "\n"+
    "[img]https://i.imgur.com/l3joqvd.png[/img] "+
    "\n"+
    "[b]Your General, Turfing and Criminal Stats SS (/stats, link only): [/b] "+StatsL+
    "\n"+
    "[b]Screenshot of your /myhistory:[/b] "+MyHistory+
    "[hr]"+
    "\n"+
    "\n"+
    "[img]https://i.imgur.com/QcCQSxd.png[/img]"+
    "\n"+
    "[b][i]I promise not to bother any Imperial members about my application, otherwise I will be Denied (Y/N): [/i][/b] "+Soi1G+
    "\n"+
    "[b][i]I agree that if I leave the group in less than a month I will be Blacklisted (Y/N):[/i][/b] "+Soi2G+
    "\n"+
    "[b][i]I meet all Imperial requirements and I understand all rules but I won’t follow them (Y/N):[/i][/b] "+Soi3G+
    "\n"+
    "[b][i]I will be forever loyal to Imperials (Y/N):[/i][/b] "+Soi4G+
    "\n"+
    ""
    }
    
    (function () {
        var onload = window.onload;
    
        window.onload = function () {
            if (typeof onload == "function") {
                onload.apply(this, arguments);
            }
    
            var fields = [];
            var inputs = document.getElementsByTagName("input");
            var textareas = document.getElementsByTagName("textarea");
    
            for (var i = 0; i < inputs.length; i++) {
                fields.push(inputs[i]);
            }
    
            for (var i = 0; i < textareas.length; i++) {
                fields.push(textareas[i]);
            }
    
            for (var i = 0; i < fields.length; i++) {
                var field = fields[i];
    
                if (typeof field.onpaste != "function" && !!field.getAttribute("onpaste")) {
                    field.onpaste = eval("(function () { " + field.getAttribute("onpaste") + " })");
                }
    
                if (typeof field.onpaste == "function") {
                    var oninput = field.oninput;
    
                    field.oninput = function () {
                        if (typeof oninput == "function") {
                            oninput.apply(this, arguments);
                        }
    
                        if (typeof this.previousValue == "undefined") {
                            this.previousValue = this.value;
                        }
    
                        var pasted = (Math.abs(this.previousValue.length - this.value.length) > 1 && this.value != "");
    
                        if (pasted && !this.onpaste.apply(this, arguments)) {
                            this.value = this.previousValue;
                        }
    
                        this.previousValue = this.value;
                    };
    
                    if (field.addEventListener) {
                        field.addEventListener("input", field.oninput, false);
                    } else if (field.attachEvent) {
                        field.attachEvent("oninput", field.oninput);
                    }
                }
            }
        }
    })();
    <form name="TRF" method="post">
    <p style="color:white">
    <div class="container">
      <div class="row">
        <div class="col-lg-12">
          <div class="jumbotron">
            <h1 class="text-center">IMPERIALS APPLICATION</h1><hr>
            <div class="row">
              <h6 class="text-uppercase"><strong><center>Imperials Application Form</center></strong></h6>
    		<table style="width:100%">
    			<h6 class="text-uppercase"><b><u>Personal Information</u></b></h6>
    			<tr>
    			
    			<td>Your Account Name:</td><td><input type="text" name="accname" size="75" placeholder="" required></td></tr>
    			<td>Your In-Game Name:</td><td><input type="text" name="iname" size="75" placeholder="" required></td></tr>
    			<tr><td>Your Serial (F8 > serial):</td><td><input type="text" name="mtaserial" size="75" placeholder="" required></td></tr>
    			</tr><tr><td>Nationality:</td><td><input type="text" name="nationality" size="75" placeholder="" required></td>
    			</tr><tr><td>Age and Gender:</td><td><input type="text" name="gender" size="75" placeholder="" required></td>
    			</tr><tr><td>Tell us about yourself (At least 25 words):</td><td><input type="text" name="aboutyourself" size="75" placeholder="" required></td></tr>
    			
    			<tr><td><h6 class="text-uppercase"><b><u>Additional Information</u></b></h6>
    			<tr><td>Average weekly playtime:</td><td><br><input type="text" name="playt" size="75" placeholder="" required></td></tr>
    			<tr><td>Your Time zone:</td><td><input type="text" name="YTZ" size="75" placeholder="" required></td></tr>
    			<tr><td>English skills (1-10):</td><td><input type="text" name="englishskills" size="75" placeholder="" required></td></tr>
    			<tr><td>Why do you want to join Imperials? (minimum 50 words): </td><td><input type="text" name="joinIM" size="75" placeholder="" required></td></tr>
    			<tr><td>Why should we accept you? (minimum 30 words): </td><td><input type="text" name="whyaccept" size="75" placeholder="" required></td></tr>
    			<tr><td>Your previous groups, your rank in each and reason for leaving them: </td><td><input type="text" name="prevgroups" size="75" placeholder="" required></td></tr>
    			<tr><td>Do you have any friends in the family? Tell us their names: </td><td><input type="text" name="friendsf" size="75" placeholder="" required></td></tr>
    			
    			
    			<td><h6 class="text-uppercase"><b><u>Player Statistics</u></b>
    			<tr><td>Your General, Turfing and Criminal Stats SS (/stats, link only): </td><td><br><input type="text" name="StatsLink" size="75" placeholder="" required></td></tr>
    			<tr><td>Your /myhistory latest logs SS (link only): </td><td><input type="text" name="historyS" size="75" placeholder="" required></td></tr>
    			</table>
    			<table style="width:100%">
    			
    			<td><h6 class="text-uppercase"><b><u>Agreements</u></b>
    		    <tr><td>I promise not to bother any Imperial members about my application, 
    			otherwise I will be Denied (Y/N): </td><td><input type="text" name="soi1" size="75" placeholder="" required></td></tr>
    		    <tr><td>I agree that if I leave the group in less than a month 
    			I will be Blacklisted (Y/N): </td><td><input type="text" name="soi2" size="75" placeholder="" required></td></tr>
    		    <tr><td>I meet all Imperial requirements and I understand all rules 
    			but I won’t follow them (Y/N): </td><td><input type="text" name="soi3" size="75" placeholder="" required></td></tr>
    		    <tr><td>I will be forever loyal to Imperials (Y/N):</td><td><input type="text" name="soi4" size="75" placeholder="" required></td></tr>
    		
    		</table>
        <h3>CODE:</h3>
    <textarea readonly id="box" cols="100" rows="10"></textarea>
    <p><a class="btn btn-success btn-lg" onclick="generateCode2()" role="button">GENERATE CODE</a></p>
            
    
            </div>
    </center> </div>
        </div>
      </div>
    </div>
</color></font>
    
          </div>
        </div>
          </div>

http://klmcit.nl/web/apply我愿意创建这样的东西。

0 个答案:

没有答案