Results 1 to 2 of 2
- 08-12-2013, 04:32 AM #1
Member
- Join Date
- Aug 2013
- Posts
- 1
- Rep Power
- 0
Generate Personal Button With Java (Textual Adventure Building)
Hi all,
I've got two questions :
I use this script, send "word" for receive "answer" :
Java Code:<form name="form1" method="post"> <textarea name="fname1" value=""></textarea><br> <input type="submit" value="send"></form> <script type="text/javascript"> function validateForm() { var x = document.forms["form1"]["fname1"].value; if (x === "word" ) { document.forms["form1"].innerHTML +=("answer"); } return false; } document.forms["form1"].onsubmit = validateForm; </script>
Java Code:<div id="1"> <input type="button" onClick="return toggleMe('2')" value="to 2"></div> <div id="2" style="display: none;"> 2 <input type="button" onClick="return toggleMe('3')" value="to 3"></div> <div id="3" style="display: none;"> 3 <input type="button" onClick="return toggleMe('4')" value="to 4"></div> <div id="4" style="display: none;"> 4 etc </div> //in <head> <script type="text/javascript"> function toggleMe(a){ var next=document.getElementById(a); var b=new String(); b= a-1; var prev=document.getElementById(b); if(!next)return true; if(next.style.display=="none"){ next.style.display="block" prev.style.display="none" window.scrollTo(0,0); } else { next.style.display="none" } return true; } </script>
Thanks for your help.
- 08-12-2013, 04:35 AM #2
Re: Generate Personal Button With Java (Textual Adventure Building)
This is a Java forum. JavaScript is not Java.
Also, cross posted in the wrong section of the Ranch:
Generate personal button with java (textual adventure building) (Beginning Java forum at JavaRanch)
I'm closing this off topic thread and it will be removed later.
db
THREAD CLOSEDIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
Similar Threads
-
Building an executable jar, then using it to generate source
By kjkrum in forum Apache MavenReplies: 1Last Post: 01-15-2013, 03:41 AM -
Help me in providing button to generate PDF of the jsp web content
By adityapandey22@gmail.com in forum New To JavaReplies: 1Last Post: 05-10-2012, 01:09 PM -
Newton Adventure
By java software in forum Java SoftwareReplies: 0Last Post: 12-29-2011, 06:46 PM -
Generate csv file on a button click
By violeta in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 09-27-2009, 03:54 AM -
Synchronization between visual and textual editor
By Mixos in forum EclipseReplies: 0Last Post: 03-03-2009, 11:45 AM
Bookmarks