www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to get Textbox value to textarea in another page?

Hybrid View

  1. #1
    Join Date
    Aug 2014
    Posts
    1

    Question How to get Textbox value to textarea in another page?

    Hello!

    I'm new here, so it's my first post. I don't know which things I need to post, but I'll try to post everything that I have and I want.
    [hr]

    I'm trying to make a HTML Application Form in which, I have form like this:

    HTML Code:
    <form>
    <font><strong>General Questions</strong></font> <br>
    <strong>Are You Human?:</strong>
    <select name="chooser">
    <option selected="selected">------- Select The Option -------</option>
    <option value="bla">Yes</option>
    <option value="blabla">No</option>
    <option value="blablabla">What Is this?</option>
    </select>
    <br>
    <strong>Name:</strong>
    <input name="usertext" type="text"><br>
    <center><input type="reset" value="Clear All Text Box" onclick="return confirm('Clear all fields?')">
    <input type="button" value="Get Code" onclick="transfer_it(chooser,usertext,readout)"><br></center>
    <center><textarea name="readout" rows="15" cols="100" readonly></textarea></center>
    </form>
    Also, I have an Javascript which uses the input name and then shows in a text area. Here is the Javascript:

    Code:
    <script type="text/javascript" language="javascript">
    
    function transfer_it(oSelect, oText, oTextarea)
    {
    	var seltext = '', usertext = '';
    	if (oSelect.selectedIndex != 0) //not default option
    		seltext = oSelect.options[oSelect.selectedIndex].text; //get displayed text
    	usertext = oText.value; //get textfield
    	if (seltext != '')
    		oTextarea.value = 'Are You Human?: ' + seltext;
    	if (usertext != '')
    		oTextarea.value += '\n\In-Game Name: ' + usertext;
    
    }
    
    	</script>
    Now, the problem is, I can't add more number of textboxes and also, I want it to sent in another HTML page.

    My friend did with PHP, but, I found that this can be done with HTML too.

    PHP Website link: http://cit-sapd.hol.es/sapd/index.php?page=apply
    HTML Website link: http://curthidalgo.url.ph/applysamd.html

  2. #2
    Join Date
    Oct 2013
    Posts
    556
    OK, this looks a bit "homeworky". I'll give you a hint. Look up sessionStorage.

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles