TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-12-2009, 06:19 AM   #1 (permalink)
The Wanderer
 
sandhyagupta's Avatar
 
Join Date: Jun 2009
Posts: 20
Thanks: 4
sandhyagupta is on a distinguished road
Default How do i get to the last line

Hi tony, wild honey
i tried to code for the populating thing which i asked u before.
here s my code:
HTML Code:
<html>
  <head>
    <script type="text/javascript">
      function ValidateForm()
      {
        var data = document.frmSample.textarea1.value
        // Code for email validation
        var mysplitresult = data.split("\n");
        document.frmSample.contactname.value = mysplitresult[0]
        m = data.match(/\w+[.]?\w+[.]?\w*@\w+[.]\w+[.]?\w+/g);
        document.frmSample.email.value = m
        // code for website
        //n = data.match(/^((http|www):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+\.[^#?\s]+)(#[\w\-]+)?$/);
        //document.frmSample.web.value = n
        // Code for spliting the phone nos
        var n = mysplitresult[1]
        var mysplitresult1 = n.split("-");
        var length1 = mysplitresult1[2].length
        //document.write(length1);
        if(length1==10)
        {
          document.frmSample.mobile.value = mysplitresult1[2]
        }
        else
        {
          document.frmSample.phone.value = mysplitresult1[2]
        }

      }
    </script>
  </head>
  <body>
    <form action=" " method="POST" name="frmSample" onsubmit="return ValidateForm()">
      <table>
        <TR>
          <TD rowspan=10>
               TextArea<textarea name = 'textarea1' rows='28' cols='80'>
               </textarea>
           </TD>
           <TD>
               <input type=button value="click" onclick="ValidateForm()">
           </TD>
        </TR>
        <TR>
           <TD>
               Contact:<input type=text name="contactname" size=25>
           </TD>
        </TR>
        <TR>
           <TD>
               Email id:<input type=text name="email" size=25>
           </TD>
        </TR>
        <TR>
           <TD>
               Mobile no:<input type=text name="mobile" size=20>
           </TD>
        </TR>
        <TR>
           <TD>
               phone no:<input type=text name="phone" size=20>
           </TD>
        </TR>
      </table>
    </form>
  </body>
</html>
i dono wtz wrng in the match function for website.. itz nt displaying it.
n hoe do i get to the last line in the text n display the address.

few egs of wt i will be pasting in the text field are:
Code:
        Mr Rama Moorthy     
        +(91)-(80)-66491588
        info@novatechnosys.co.in 
        ramamoorthym@novatechnosys.co.in 
        No.729,1st Flr, Hal 2nd Stg, 8th Crs,11th Mn, Indiranagar, Bangalore - 560038



      
        Mr Srinivas(Managing Director)    
        +(91)-(80)-66492233
        srinivas@vyasam.com 
        chetan@vyasam.com 
        No. 1 & 2, 3rd Flr, Nr Sharavathi Hospital, Service Rd, Vijaynagar, Bangalore - 560040


          Mr Ananda Reddy K     
        +(91)-(80)-66366685
        ananda@srivatech.com
        www.srivatech.com
        No.430,, 5th Main, Shastri Nagar, Bangalore - 560028

Last edited by Salathe : 06-12-2009 at 01:20 PM. Reason: Wrapping HTML/Examples in code blocks.
sandhyagupta is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Line Chart in PHP Rendair Advanced PHP Programming 3 08-28-2009 08:17 AM
parsing a page line by line sarmenhb Absolute Beginners 3 12-04-2008 01:58 AM
Adding content to a specific line in file Normo Absolute Beginners 5 10-09-2008 11:20 PM
Need help on nested loop! pabin Absolute Beginners 4 05-12-2008 10:27 AM
uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ER Orc Javascript, AJAX, E4X 2 02-26-2008 02:12 PM


All times are GMT. The time now is 03:33 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design