473,320 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Need help in getelement by ID

Hi,

I am new here i need help in my script, all the things are working fine the only problem is that when user click on <div class="addButton"><a href="javascript:showElem('field2')">&nbsp;</a></div> and enter the text in the input feild the text does not go to next line, i want to break the line when it comes to end of the feild. please see the script below.


<script>
<!-- Edit Text Field Script Start
function editTitle(id, newClass){
var elem = document.getElementById(id);
elem.className = newClass;
}
// Edit Text Field Script End

// Show Hide Element Script Start
function hideElem(id){
var elem = document.getElementById(id);
elem.style.display = 'none';
}
function showElem(id){
var elem = document.getElementById(id);
elem.style.display = 'block';
}
// Show Hide element Script End

// Image RollOver Script
function newImage(imgID,imgSrc) {
document.getElementById(imgID).src=imgSrc;
}

function oldImage(imgID,imgSrc) {
document.getElementById(imgID).src=imgSrc;
}
function overlay() {
el = document.getElementById("overlay");
opaqueLength = document.getElementById("MediaContainer").offsetHe ight;
el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
el.style.height = (opaqueLength + 265) + 'px';
}
function showDialogue() {
win = document.getElementById("dialogueBox");
win.style.visibility = (win.style.visibility == "visible") ? "hidden" : "visible";
}

// end Image RollOver Script -->
-->
</script>




Thanks,

Khurram
May 21 '07 #1
3 11764
acoder
16,027 Expert Mod 8TB
If I understand correctly, you want to automatically wrap to the next line when it reaches the end of the display. In that case, you might be better off using a textarea with multiple lines instead of a input text field.
May 21 '07 #2
If I understand correctly, you want to automatically wrap to the next line when it reaches the end of the display. In that case, you might be better off using a textarea with multiple lines instead of a input text field.

Hey,

Thanks dude it works thanks for the help :D

I have one more problem please also help me in this script. in this script you will see href links of cancel and save. when user click on a button one dialogue box open with link of cancel and save and when cancel and save is clicked the dialogue box get close it is working fine but i also want to close the dialogue box when user hit the Enter key on keyboard. how would i do that?


<div class="addButton"><a href="javascript:showElem('field1')">&nbsp;</a></div>
<span class="greySmallText">&nbsp;Add Tag</span>
</p>
<div id="field1" style="display:none;">
<p>
<textarea name="text" type="text" class="editableText"></textarea>
<br />
</p>
<p align="right" class="cancelSavelink"><strong><a href="javascript:hideElem('field1')">CANCEL</a></strong> | <strong><a href="javascript:hideElem('field1')">SAVE</a></strong></p>
</div>


Thanks,

Khurram
May 22 '07 #3
acoder
16,027 Expert Mod 8TB
I have one more problem please also help me in this script. in this script you will see href links of cancel and save. when user click on a button one dialogue box open with link of cancel and save and when cancel and save is clicked the dialogue box get close it is working fine but i also want to close the dialogue box when user hit the Enter key on keyboard. how would i do that?
Have buttons instead and give the default one focus on page load.
May 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Sofia | last post by:
My name is Sofia and I have for many years been running a personals site, together with my partner, on a non-profit basis. The site is currently not running due to us emigrating, but during its...
6
by: Robert Maas, see http://tinyurl.com/uh3t | last post by:
System login message says PHP is available, so I tried this: http://www.rawbw.com/~rem/HelloPlus/h.php It doesn't work at all. Browser just shows the source. What am I doing wrong?
0
by: Gregory Nans | last post by:
hello, i need some help to 'tree-ify' a string... for example i have strings such as : s = """A(here 's , B(A ) silly test) C(to show D(what kind) of stuff i need))""" and i need to...
7
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a...
8
by: JustSomeGuy | last post by:
I need to write an new class derived from the list class. This class stores data in the list to the disk if an object that is added to the list is over 1K in size. What methods of the std stl...
28
by: Randy Starkey | last post by:
Hi, Does anyone know where I can get a script that show a little plus sign after a line of text, that when you click the plus sign, more text is revealed on that same page, like a continuing...
1
by: Michael Brown | last post by:
I've got some code that looks somewhat like this: typedef struct TAG_STREAMDATA { // Lots of stuff in here ... double param1, param2; } STREAMDATA;
3
by: Bob.Henkel | last post by:
I write this to tell you why we won't use postgresql even though we wish we could at a large company. Don't get me wrong I love postgresql in many ways and for many reasons , but fact is fact. If...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.