473,508 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modify textbox

rwt
2 New Member
Hello,
I have no knowlege of javascript whatsoever so don't laugh at me please.
From a selection menu, I want people to be able to change a part of the text in the textbox bellow. How can I do that?

Here are my forms:
[HTML]<form method="POST" action="">
<select size="1" name="D1">
<option value="">linkone.com</option>
<option value="">linktwo.com</option>
<option value="">linkthree.com</option>
</select><input type="submit" value="Submit" name="B1"></p>
</form>
<form method="POST" action="">
<p><textarea rows="9" name="S1" cols="44"></textarea><input type="reset" value="Reset" name="B2"></p>
</form>[/HTML]
Aug 10 '06 #1
2 3080
iam_clint
1,208 Recognized Expert Top Contributor
Expand|Select|Wrap|Line Numbers
  1. <form method="POST" action="">
  2. <select size="1" name="D1" onchange="document.getElementById('look').innerHTML = this.value;">
  3.     <option value="linkone.com">linkone.com</option>
  4.     <option value="linktwo.com">linktwo.com</option>
  5.     <option value="linkthree.com">linkthree.com</option>
  6.     </select><input type="submit" value="Submit" name="B1"></p>
  7. </form>
  8. <form method="POST" action="">
  9.     <p><textarea rows="9" name="S1" cols="44" id="look"></textarea><input type="reset" value="Reset" name="B2"></p>
  10. </form>
  11.  
Heres a simple way of doing it
Aug 10 '06 #2
ssuthar
1 New Member
I just have a question. Your code works fine, except in cases like follows:

For example: A merchant is trying to send out canned message email like:

$form .= "<option value=\"$shipping_today\">Shipping Today</option>";
$form .= "<option value=\"$shipping_soon\">Shipping Soon</option>";
$form .= "<option value=\"$shipping_drop\">Drop Shipping</option>";

Assume that the variables $shipping_today, $shipping_soon, and $shipping_drop don't have any HTML tags in them, the code would work fine. But if there are any HTML tags like <BR> or <P>, the code would give java runtime error.

I was wondering if there is any other method that would allow this. Basically, I am trying to use this solution to send out canned HTML messages. The box would change based on the selection chosen in the dropdown. Without any HTML tags in the variable, the message would be a single blob.

Thanks in advance...
Sep 29 '06 #3

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

Similar topics

4
3571
by: MikeY | last post by:
Hi everyone, I have posted earlier this week, but I'm still scratching my head trying to figure out how to change/modify my data back to my db. Using C# Windows forms. I am trying to learn how...
0
287
by: livinginmatrix | last post by:
Hi to all. I have the small class below. and a webform empty to test this class... If i call to the method generate fields the application show me the fields, if i click the button the controls...
1
1041
by: Jax | last post by:
Is there any way to actually force a focus to change it's position? E.G TextBox.Focus.MoveRight(1); or somekind of method that can move it? jax
1
1382
by: VM | last post by:
In my Windows application, I use the streamreader to display a txt file into multi-line textbox and /streamwriter to modify the txt file if the user decides to change the contents through the...
1
3032
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! Can any one point me in direction of modify a TextBox control. What i want to do is to add a button, like the ComboBox have. with my own bitmap and execute an Event when clicked. I...
4
2185
by: Jason Cowsill | last post by:
Hi - I am looking for a way to dynamically alter a textbox WHILE the user is typing in it. One example would be while a user is entering their phone number a dash would be entered automatically...
2
2128
by: leila | last post by:
I am developing an ASP.Net application for a client and they need to modify the page layout from within a form. like the way you edit a blog template in Blogger. what is the best approach to do...
4
1961
by: clintonG | last post by:
Technically speaking, this issue is not about modifying the HTML generated by server controls but preceding the HTML generated by server controls with an HTML control generated on the basis of the...
0
1296
by: macupryk | last post by:
I press modify button and there is an arror beside the row. Then I call a dialog with a ScaleName, ScaleDescription to modify. private void ultraButtonModifyScale_Click(object sender, EventArgs e)...
0
988
by: ezrollers | last post by:
I'm still learning C# and this is really annoying me. I need to modify the contents of a text box on a windows program. (Using windows app template on VS 2005) I have created a property on...
0
7127
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7391
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7501
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.