Ex:(multiline textbox value)(Address is one multiline textbox)
| Address:127,kovil street,tnagar,chennai-600017,near bus terminal. |
| Doorno: | 127 |
| Street Name: | kovil street |
| Area: | t.nagar ,Chennai |
| Pincode: | 600017 |
| Land Mark: | near bus terminal |
| Address:127,kovil street,tnagar,chennai-600017,near bus terminal. |
| Doorno: | 127 |
| Street Name: | kovil street |
| Area: | t.nagar ,Chennai |
| Pincode: | 600017 |
| Land Mark: | near bus terminal |
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
venky nPosted Feb 7, 2015, 5:40 AM
venky nPosted Feb 7, 2015, 5:27 AM
Joginder BangerPosted Feb 7, 2015, 5:20 AM
And I have make a one class for hold the address like this type.
Suraj SahooPosted Feb 7, 2015, 5:14 AM
And giving the full source code is not what permits here.
You try out with the concept, we here are always there tohelp you wherever you get stuck.
So, i would recommend you please start the work on the code and post the snippet if you get stuck or post questions wherever you feel any problem
Thanks again.
Suraj SahooPosted Feb 7, 2015, 4:25 AM
Here what you need to do is, fetch the textbox/textarea value. Then separate the entire string by splitting it based on the "," character, which you have added. Then based on the sequence of input assign to each variable or model what ever suits you like below:
var addressModel = {
DoorNo:"",
StreetName:"",
Area:"",
Pincode:"",
LandMark:""
}
Then after the split based on "," assign like suppose
var splittedAddress = textboxValue.Split(",") //Not sure of syntax will provide you link for splitting based on comma
Then addressModel.DoorNo = splittedAddress[0] and so on...
Then pass the model in data in the ajax call.
Links for split:
http://www.w3schools.com/jsref/jsref_split.asp
http://stackoverflow.com/questions/3245088/how-to-split-a-comma-separated-string-and-process-in-a-loop-using-javascript
I hope i could explain you.
Thanks.
Accept if helped you anyway.