I am trying to figure out how to call a second prompt after clicking "Ok". I need the second promt to ask for a simple text and then when "ok" is clicked again it will fill the text area with the user's input. I'm not very good with js so I need alot of help. Anyone have any ideas?
When you click Ok before the second prompt is displayed, what is displayed? a prompt or just an alert box?
The first prompt ask's for a URL and when ok is clicked the URL is input into the text area.(post editor) The second prompt needs to ask for plain text and when ok is clicked it needs to do the same. If it helps it is like vb post editor on digital point. Thank you so much for a quick response.
Wait, so you want the url and the text to be changed into a hypelink? e.g. 1st prompt = http://www.google.com 2nd prompt = Search Engine Search Engine
Is this what you wanted <script language="javascript"> window.onload = function() { textarea = document.getElementById('text'); url = prompt('enter url',''); if(url.length > 1) { text4url = prompt('enter text',''); textarea.value += '<a href='+url+'>'+text4url+'</a>'; } } </script> <textarea id="text" cols="90" rows="30"> </textarea>
you forgot a piece in the codeing the hyper link wouldnt have worked with out the <a href="url">text</a> <script language="javascript"> window.onload = function() { textarea = document.getElementById('hpgenerator'); hpurl = prompt('Enter The URL without \n\ http://www.',''); if(hpurl.length > 1) { hptext = prompt('Enter URL text',''); textarea.value += '<a href="http://www.'+hpurl+'/">'+hptext+'</a>'; } } </script> <textarea id="hpgenerator" cols="90" rows="30"> </textarea>
Heres A New One You Can Create a Hyper Link Click Ctrl + R and Create another HyperLink ect.ect. With a Select all Generated Content Button ------------------------------------------ <!-- This Script Was Created by Cynscriptz --!> <script language="javascript"> window.onload = function() { textarea = document.getElementById('select1'); hpurl = prompt('Enter The URL without \n\ http://www.',''); if(hpurl.length > 1) { hptext = prompt('Enter URL text',''); textarea.value += '<a href="http://www.'+hpurl+'/">'+hptext+'</a><br>'; } } </script> <script language="Javascript"> <!-- function selectAll(theField) { var tempval=eval("document."+theField) tempval.focus() tempval.select() } //--> </script> <b> Hit "Ctrl + R" to add another Link</b><br> This Script is to Create Hyper Links Faster Than Hand Typing Them<br> <br> <form name="generated"> <a href="javascript:selectAll('generated.select1')">Select All</a><br> <textarea name="select1" id="select1" cols="42.5" rows="50" value="<font size="1"> Powered by <a href="http://cynscriptz.com"><font size="1">Cynscriptz</font></a><br> </textarea> </form> <br><br> This was Generated by The Script<br><br> Powered by <a href="http://cynscriptz.com"><font size="1">Cynscriptz</font></a><br> <a href="http://www.google.com/">Google</a><br><a href="http://www.myspace.com/">Myspace</a><br><a href="http://www.youtube.com/">Youtube</a><br> <!-- This Script Was Created by Cynscriptz --!> Code (markup):
Heres Another That Does Linked Images Type Full image url then type website url example google.com <!-- This Script Was Created by Cynscriptz --!> <script language="javascript"> window.onload = function() { textarea = document.getElementById('select1'); imgurl = prompt('Enter The Whole Image URL with \n\ http://www.',''); if(imgurl.length > 1) { hpurl = prompt('Enter Website Image is Linked to without \n\ http://www.',''); textarea.value += '<a href="http://www.'+hpurl+'"><img src="'+imgurl+'" border="0"></a><br>'; } } </script> <script language="Javascript"> <!-- function selectAll(theField) { var tempval=eval("document."+theField) tempval.focus() tempval.select() } //--> </script> <b> Hit "Ctrl + R" to add another I-Hyper Link</b><br> This Script is to Create Image Hyper Links Faster Than Hand Typing Them<br> <br> <form name="generated"> <a href="javascript:selectAll('generated.select1')">Select All</a><br> <textarea name="select1" id="select1" cols="42.5" rows="50" value="<font size="1"> Powered by <a href="http://cynscriptz.com"><font size="1">Cynscriptz</font></a><br> </textarea> </form> <br><br> This was Generated by The Script<br><br> Powered by <a href="http://cynscriptz.com"><font size="1">Cynscriptz</font></a><br> <a href="http://www.hotmail.com"><img src="http://gfx2.hotmail.com/mail/w3/pr01/ltr/i_yellowshield.gif" border="0"></a><br> <!-- This Script Was Created by Cynscriptz --!> Code (markup):