|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
textarea problem
hi,
i created a form having textbox field and besides that there is image when i click on this image a pop window open having text area and 2 buttons clear and add,so when i type soem message in text area and clcik on add it will add in this text field and clear to clear the message now problem ,is it possible when i type in TEST in this textbox field and clicks on thsi image i can see this TEST in text area field and when change it saves in this textbox also when i type let say 20 characters in text area and save in text field as this text field size is limited upto 12 he cant see rest 8 characters so when i mouseon this textbox field i can see the whole message upto 20 characters or some alert message thanks in advance /*** this is the form in which text field is limited upto 12***/ <td nowrap align="center"> <input type="text" name="text" size="10" maxlength="12"> <img src="../img/edit.gif" onclick="window.open('thewindow.html','newWin','width=150,h eight=130,top=400,left=600,dependent=yes,alwaysRai sed=yes,resizable=1')" width="16" height="16" border="0" alt="Edit Text"></a> </td> /***** on clcik on image thewindow.html is opening******/ <HTML> <head><title>edit</title></head> <link rel="stylesheet" type="text/css" href="../styles/styles.css" /> <script language="javascript"> </script> <CENTER> <FORM NAME=aform> <BODY bgcolor="#FF9900" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"> <textarea NAME=text1 style="width:200px;height:100px"></textarea> <input type="button" value="CLEAR" onClick="document.aform.text1.value=''"> <input type="button" align="right" value="ADD" onClick="window.opener.document.tstest.text.value=document. aform.text1.value;self.close()"> </BODY> </FORM> </CENTER> </HTML> |
|
#2
|
|||
|
|||
|
RE: textarea problem
To pre-populate the textarea in the popup window (thewindow.html), put this onLoad code in the body tag of the thewindow.html file.
onLoad="window.document.aform.text1.value = window.opener.document.tstest.text.value" I would suggest changing the text box on the first page to a textarea with to solve your second problem. let me know if that helps |
|
#3
|
|||
|
|||
|
RE: textarea problem
thanks first is workign fine onLoad but changing text to text area in first form looks very ugly,i mean to say since im using table and its take too much space when i clicks on submit the text saves in same page
<td nowrap align="center"> <textarea name="text" COLS=2 ROWS=2></textarea> <img src="../img/edit.gif" onclick="window.open('thewindow.html','newWin','width=150,h eight=130,top=400,left=600,dependent=yes,alwaysRai sed=yes,resizable=1')" width="16" height="16" border="0" alt="Edit Text"></a> </td> <td nowrap align="center"> //this save inserts this text value in database and at the same time it retrieves from database and print below the text field <input type="button" value="S" name="Save" border="1" onclick="go();"> //to retrieve the value of text <td nowrap align="center"><?= $line["text"] ?></td> </td> let say if i enter HI how are you thanks for your suggestions and click on submit very next line i get this whole text in single line i just want to limit the text may be upto 10 characters but when i put my mouseon i can see the read whole text for each and every line it will show alt so how i can put something like "alt" to see the complete text and at the same time it wont take too much space to avoid ugly looking thanks in advance |
|
#4
|
|||
|
|||
|
RE: textarea problem
I can't write the code for you, but I can tell you that to limit the length of the text in the text field, you can use the javasript substring() function to display only 10 charachters in the box. As for a popup that displays the whole string on a mousover, I am not quite sure how you would handle that. I have not done that myself, but I am sure someone has so search the internet and you will probably find a script.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > textarea problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|