So Kerm, you've done it again XD forcing me to post my random projects on cemetech.
Alright, here we go. I need a project template because i have NO clue how to operate in languages outside JS and HTML. Here's the deal, I've been coding some simple code on a Role-Play site. Limitations are that i can't use <script> tags, they get removed when displaying the page. If I use javascript in a <button> tag or what not, works flawlessly. Now, on this profile page, I've started creating buttons that show/hide <div> tags accordingly. Hide all, show desired. The current Button im working on, will show a small form to fill out. Asks for your name(text), your gender(4 options), which of my RP characters you want to RP with(6 options), RP length(4 options), and key terms you want in the search(text).
Using a submit button is out of the question. I want everything to be accessible from the page by default. When you click <input type="button"> it should query for a matching (random) RP starter, and post it to <textarea id="results>, hide the form div, and show the results div. the following code works, though the script will have to be edited to work to your code =.=
Code:
The script tag is used off-site for testing purposes, it will eventually be added into the button onclick event. What i need is for someone to write in a code of their choosing (i can host the code on a free page of mine to be called from) and alter the selected source to work with it.
The template you make will need to have at least 2 basic replies, and post them in the message. Best of luck!
Alright, here we go. I need a project template because i have NO clue how to operate in languages outside JS and HTML. Here's the deal, I've been coding some simple code on a Role-Play site. Limitations are that i can't use <script> tags, they get removed when displaying the page. If I use javascript in a <button> tag or what not, works flawlessly. Now, on this profile page, I've started creating buttons that show/hide <div> tags accordingly. Hide all, show desired. The current Button im working on, will show a small form to fill out. Asks for your name(text), your gender(4 options), which of my RP characters you want to RP with(6 options), RP length(4 options), and key terms you want in the search(text).
Using a submit button is out of the question. I want everything to be accessible from the page by default. When you click <input type="button"> it should query for a matching (random) RP starter, and post it to <textarea id="results>, hide the form div, and show the results div. the following code works, though the script will have to be edited to work to your code =.=
Code:
<script type="text/javascript">
function poststarter() {
if (document.getElementById("username").value == "") {
document.getElementById("results").value = "Please enter a name first!";
return;
}
val ret = "Sorry, No Roleplays with these parameters
could be found!";
document.getElementById("results").value = ret;
}
</script>
<div id="starter" style="display:none;">
<div id="form">
<b>Random Starter Generator:</b><br>
<form name="myForm" method="post">
<b>Your Name:</b> <input type="text" name="fname" id="username"><br>
<b>Gender:</b>
<select id="gender" size="1">
<option value="0">Hidden</option>
<option value="1">Male</option>
<option value="2">Female</option>
<option value="3">Other</option>
</select>
<b>RP Option:</b>
<select id="type" size="1">
<option value="0">No Preference</option>
<option value="1">Human</option>
<option value="4">Human(Cyber)</option>
<option value="2">Meta-Human</option>
<option value="3">Furry</option>
<option value="5">Furry(Cyber)</option>
</select></br>
<b>RP Length:</b>
<select id="type" size="1">
<option value="0">Dynamic</option>
<option value="1">Short</option>
<option value="2">Mid</option>
<option value="3">Long</option>
</select></br>
<b>Key Term(s):</b> <input type="text" name="fkeys"><br>
<input type="button" onclick="poststarter();document.getElementById('form').style.display =
'none';document.getElementById('result').style.display = '';" value="Submit"/>
</form>
</div>
<div id="result" style="display:none;">
<form name="myResults" method="post">
<textarea id="results" name="results" cols="40" rows="5"></textarea></form>
<br>
<input type="button" onclick="document.getElementById('form').style.display =
'';document.getElementById('result').style.display = 'none';" value="Retry"/>
</div>
<br>
<hr />
</div>
The script tag is used off-site for testing purposes, it will eventually be added into the button onclick event. What i need is for someone to write in a code of their choosing (i can host the code on a free page of mine to be called from) and alter the selected source to work with it.
The template you make will need to have at least 2 basic replies, and post them in the message. Best of luck!