| View previous topic :: View next topic |
| Author |
Message |
optomeb
Joined: 19 May 2006 Posts: 113
|
| Hey.. I am trying to use createTextRange on a textarea object but it keeps returning undefined, the textarea is not null though.. anyone know what I'm forgetting? |
| |
|
|
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| did you define it? |
| |
|
|
optomeb
Joined: 19 May 2006 Posts: 113
|
| Defined which of them? the textrange? |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
| Your textrange var |
| |
|
|
optomeb
Joined: 19 May 2006 Posts: 113
|
Ah.. well yea.. I got a var rng = tbx.createTextRange; doesnt that qualify as defining it?
Hmm.. or do I have to define it on the textarea somehow first? |
| |
|
|
montanarry
Joined: 13 May 2006 Posts: 175
|
You did use name on the textarea right
Mandatory
Just sayinn |
| |
|
|
optomeb
Joined: 19 May 2006 Posts: 113
|
Well.. I got it like this.. var tbx = document.getElementById("textareaId").. then I used tbx.createTextRange
Er.. or what do you mean? =)
I'm quite a rookie at javascript.. |
| |
|
|
Poolkop
Joined: 01 Jun 2006 Posts: 123
|
| Have you set the id and name for form (textarea) ? |
| |
|
|
optomeb
Joined: 19 May 2006 Posts: 113
|
| Hmm not the name |
| |
|
|
Poolkop
Joined: 01 Jun 2006 Posts: 123
|
I never do that in textarea, but let me share similiar case:
<form name="add_tour" action="tour.php" method="post" onSubmit=showSelected()> <input id="add_tour_category" name="add_tour_category" type="hidden"> <select id="Enabled_Category" name="Enabled_Category" size="5" multiple style="width: 100px;"><option blah blah></select><input type="submit" value="Submit"></form>
In javascript:
Var optionList_Category = document.getElementById("Enabled_Category").options; var data_Category = ''; var len_Category = optionList_Category.length; etc
That will get all value in Enabled_Category :)
About this: <input id="add_tour_category" name="add_tour_category" type="hidden"> i will send the processed value to tour.php
So there will be something like this: document.getElementById('add_tour_category').value = data_Category;
Maybe this can give you an idea of your problem |
| |
|
|
| Page 1 of 3 |
Goto page 1, 2, 3 Next |
|