 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
 |
|
 |
06-12-2009, 06:19 AM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 20
Thanks: 4
|
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.
|
|
|
|
06-12-2009, 08:22 AM
|
#2 (permalink)
|
|
The Acquainted
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
|
OMG! FFS! Hoe bout u tri usin sum code tagz n stop typin lyk dis on a forum!
|
|
|
06-12-2009, 09:26 AM
|
#3 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 20
Thanks: 4
|
stop typing like this on a forum means wt? so plz tell me hw m i supposed to type?
|
|
|
|
06-12-2009, 10:05 AM
|
#4 (permalink)
|
|
The Acquainted
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
|
ERROR!
ID: 10t
|
|
|
06-12-2009, 10:08 AM
|
#5 (permalink)
|
|
The Prestige
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
|
I have a feeling he means, wrap the code in the related bbcode tags.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
|
|
|
|
|
The Following User Says Thank You to sketchMedia For This Useful Post:
|
|
06-12-2009, 01:15 PM
|
#6 (permalink)
|
|
The Wanderer
Join Date: Mar 2008
Posts: 20
Thanks: 0
|
If it's always going to be the very last line of your pasted text you can put this line inside your function:
Code:
mysplitresult[mysplitresult.length-1]
Hope that helps.
|
|
|
|
06-13-2009, 05:09 AM
|
#7 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 20
Thanks: 4
|
@ Schroder Thanks a lot. will try using it in the code. it may help me out.
|
|
|
|
06-12-2009, 01:21 PM
|
#8 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
Note: I've edited the first post to wrap code/examples in prettiness.
|
|
|
|
06-13-2009, 05:11 AM
|
#9 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 20
Thanks: 4
|
@ Salathe thanks a lot for your help. i dint know about this. from next time i shall make sure to wrap the code and post. Sorry for the trouble
|
|
|
|
06-12-2009, 02:25 PM
|
#10 (permalink)
|
|
The Acquainted
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
|
Can you not edit the SMS language as well?! 
|
|
|
06-12-2009, 03:17 PM
|
#11 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
I apologize for the rudeness of people here. We have a BBcode that you can wrap code in, that tag is [code] and [/code].
Also, this belongs in the general coding section, so I'm moving it there.
|
|
|
|
06-13-2009, 05:19 AM
|
#12 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 20
Thanks: 4
|
@ Village Idiot Yeah as i said thanks a lot to you also. i was not aware of this. sorry for causing all u people trouble. thank u once again.
|
|
|
|
06-13-2009, 02:54 PM
|
#13 (permalink)
|
|
The Acquainted
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
|
Hi everyone, sorry for being so sharp yesterday - wasn't having the best of days. Still, that's no reason for the comments I made.
Sorry sandhyagupta
All I meant was to wrap your code to make it easier to read.
|
|
|
06-14-2009, 01:12 AM
|
#14 (permalink)
|
|
The Contributor
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
|
Quote:
Originally Posted by Hightower
Hi everyone, sorry for being so sharp yesterday - wasn't having the best of days. Still, that's no reason for the comments I made.
Sorry sandhyagupta
All I meant was to wrap your code to make it easier to read.
|
Now i'm gonna be the fucker that everyone hates.. but damn don't apologize because someone skipped school. I've read the initial post several times and I still can't understand what the hell he/she is saying. (Not everyone has English as their first language, uhm and the sms lingo is way beyond my head.)
Your reply is justified. And I like! :)
Hjalmar
|
|
|
|
06-15-2009, 09:52 AM
|
#15 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 20
Thanks: 4
|
Quote:
Originally Posted by Hightower
Hi everyone, sorry for being so sharp yesterday - wasn't having the best of days. Still, that's no reason for the comments I made.
Sorry sandhyagupta
All I meant was to wrap your code to make it easier to read.
|
Thats ok not a problem.
|
|
|
|
06-13-2009, 02:58 PM
|
#16 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
That's okay, Hightower  I thought you were a bit cruel, too, but nonetheless, the apology is more than appreciated! Happy days.
Has this issue of extracting the last line been resolved, by the way?
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
06-15-2009, 09:55 AM
|
#17 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 20
Thanks: 4
|
Hi wildhoney,
Thaks a lot for the support.Yes my problem has been resolved. My program is working fine :)
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|