?
Solved

copy from textbox form

Posted on 2009-04-03
4
Medium Priority
?
551 Views
Last Modified: 2013-11-11
how could i copy from email textbox when submit ..it will redirect to contact page to fill the remaining but should copy the email which intered....

how could i achieve that???
0
Comment
Question by:saad220
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24136604
you can create one page eg: first.html and call below code.


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
        function getEmailID() {
            var email = document.getElementById('txtEmailID').value;
            window.open('contact.html?email=' + email);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input type=text id="txtEmailID" />
        <input type=button onclick="getEmailID()" />
    </div>
    </form>
</body>
</html>

Open in new window

0
 
LVL 31

Accepted Solution

by:
RiteshShah earned 1000 total points
ID: 24136666
more refined code.

create one page named First.html and paste below code there in first.html

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
        function getEmailID() {
            var email = document.getElementById('txtEmailID').value;
            window.open('contact.html?email=' + email);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <input type="text" id="txtEmailID" />
        <input type="button" onclick="getEmailID()" />
    </div>
    </form>
</body>
</html>



now create second page named contact.html and paste below code in that.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function getEmail() {

            document.getElementById('txtEmailID').value = getQuerystring('email');
        }
        function getQuerystring(key, default_)
        {
          if (default_==null) default_="";
          key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
          var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
          var qs = regex.exec(window.location.href);
          if(qs == null)
            return default_;
          else
            return qs[1];
        }


    </script>
</head>
<body onload="getEmail()">
    <form id="form1" runat="server">
    <div>
<input type="text" id="txtName"/>        
<input type="text" id="txtEmailID" />
       
    </div>
    </form>
</body>
</html>

now you are done. run First.html, enter email in text box and click on button, there will be two text box in second page one is for name and another one is for email. You will get email text box already filled up.
0
 

Author Comment

by:saad220
ID: 24139746
thanks.

i am not using ASP i amean what is runat="server"??

could u make it in java script or php Please?

thanks

0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24139767
ohh sorry, remove Runat="Server" attribute, this is completely in Javascript no need of ASP or even PHP
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question