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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suraj SahooRank #382 · 6.6K reputationPosted Feb 6, 2015, 11:25 PM EST
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.
Joginder BangerRank #360 · 7K reputationPosted Feb 7, 2015, 12:20 AM EST
And I have make a one class for hold the address like this type.
Suraj SahooRank #382 · 6.6K reputationPosted Feb 7, 2015, 12:14 AM EST
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.
venky n115 reputationPosted Feb 7, 2015, 12:27 AM EST
venky n115 reputationPosted Feb 7, 2015, 12:40 AM EST