473,395 Members | 2,010 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,395 software developers and data experts.

inputbox

Hi.

How to change the text of inputbox if i have already set the style for
something else?

In other words:
<input name="fItem" type="text" id="fItem" style="border:hidden" size="80"
maxlength="60" border="0" />

I can not add two styles on the same inputbox so i guess that javascript is
the only solution?
If so, then how ?
Regards!
Sep 23 '08 #1
7 3721
On Sep 23, 11:27*am, "Intos" <in...@mail.comwrote:
Hi.

How to change the text of inputbox if i have already set the style for
something else?

In other words:
<input name="fItem" type="text" id="fItem" style="border:hidden" size="80"
maxlength="60" *border="0" />

I can not add two styles on the same inputbox so i guess that javascript is
the only solution?
If so, then how ?

Regards!
<input ... style="border:hidden; color:blind; some:other;" ... />
Is that what you wanted?
Sep 23 '08 #2

Intos schreef:
Hi.

How to change the text of inputbox if i have already set the style for
something else?

In other words:
<input name="fItem" type="text" id="fItem" style="border:hidden" size="80"
maxlength="60" border="0" />

I can not add two styles on the same inputbox so i guess that javascript is
the only solution?
If so, then how ?
Hi,

In your case:
document.getElementById("fItem").style.border='1px solid #99999;';

Of course you can assign anything valid to the style.

Regards,
Erwin Moller

>

Regards!


--
============================
Erwin Moller
Now dropping all postings from googlegroups.
Why? http://improve-usenet.org/
============================
Sep 23 '08 #3
"Erwin Moller"
<Si******************************************@spam yourself.comwrote in
message news:48*********************@news.xs4all.nl...
>
Intos schreef:
>Hi.

How to change the text of inputbox if i have already set the style for
something else?

In other words:
<input name="fItem" type="text" id="fItem" style="border:hidden"
size="80" maxlength="60" border="0" />

I can not add two styles on the same inputbox so i guess that javascript
is the only solution?
If so, then how ?

Hi,

In your case:
document.getElementById("fItem").style.border='1px solid #99999;';

Of course you can assign anything valid to the style.

Regards,
Erwin Moller

>>

Regards!


--
============================
Erwin Moller
Now dropping all postings from googlegroups.
Why? http://improve-usenet.org/
============================
----------------
Thank you guys, that's it. Just one small thing. How to align the text of
the input box in the center of the inputbox ?
Sep 23 '08 #4
GArlington wrote:
On Sep 23, 11:27 am, "Intos" <in...@mail.comwrote:
>How to change the text of inputbox if i have already set the style for
something else?

In other words:
<input name="fItem" type="text" id="fItem" style="border:hidden" size="80"
maxlength="60" border="0" />

I can not add two styles on the same inputbox so i guess that javascript is
the only solution?
If so, then how ?

<input ... style="border:hidden; color:blind; some:other;" ... />
Is that what you wanted?
Unlikely, since it is not Valid HTML or CSS in the first place.

<http://validator.w3.org/>
<http://jigsaw.w3.org/css-validator/>
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Sep 23 '08 #5
SAM
Intos a écrit :
Hi.

How to change the text of inputbox if i have already set the style for
something else?
document.forms[0].elements['myInput'].value = 'some text';
In other words:
<input name="fItem" type="text" id="fItem" style="border:hidden" size="80"
maxlength="60" border="0" />

I can not add two styles on the same inputbox so i guess that javascript is
the only solution?
certainly not
If so, then how ?
Perhaps would you have to learn a bit about CSS ?

In JS :

var d = document.forms[0].elements['myInput'].style:
d.color = 'blue';
d.fontWeight = 'bold';
d.textDecoration = 'underline';
d.textAlign = 'center';
etc ... etc ...
try :

<html>
<style type="text/css">
..red { color: red }
..blu { color: blue }
..bold { font-weeight: bold; }
input { color: inherit; border: 3px solid green }
</style>

<form action="#" onsubmit="return false">
<p class="red" id="one">
<input value="test 1">
<input value="test 2 (blue n' bold by class)" class="blu bold">
<input value="test 1">
</p>
<p class="blu" id="two">
<input value="test 4">
<input value="test 5 (red n' bold by style)"
style="color:red;font-weight:bold"">
<input value="test 6">
</p>
<p><button onclick="var d =document.getElementById('one');
d.className = d.className=='red'? 'blu' : 'red';">toggle 1</button>
<button onclick="var d =document.getElementById('two');
d.className = d.className=='red'? 'blu' : 'red';">toggle 2</button>
</form>
</html>

--
sm
Sep 23 '08 #6
On Sep 23, 8:41*am, "Intos" <in...@mail.comwrote:
"Erwin Moller"
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote in
messagenews:48*********************@news.xs4all.nl ...


Intos schreef:
Hi.
How to change the text of inputbox if i have already set the style for
something else?
In other words:
<input name="fItem" type="text" id="fItem" style="border:hidden"
size="80" maxlength="60" *border="0" />
I can not add two styles on the same inputbox so i guess that javascript
is the only solution?
If so, then how ?
Hi,
In your case:
document.getElementById("fItem").style.border='1px solid #99999;';
Of course you can assign anything valid to the style.
Regards,
Erwin Moller
Regards!
--
============================
Erwin Moller
Now dropping all postings from googlegroups.
Why?http://improve-usenet.org/
============================

----------------
Thank you guys, that's it. Just one small thing. How to align *the textof
the input box in the center of the inputbox ?- Hide quoted text -

- Show quoted text -
document.getElementById("fItem").style.textAlign=" center"
Sep 23 '08 #7

"Intos" <in***@mail.comwrote in message
news:gb**********@localhost.localdomain...
Hi.

How to change the text of inputbox if i have already set the style for
something else?

In other words:
<input name="fItem" type="text" id="fItem" style="border:hidden" size="80"
maxlength="60" border="0" />

I can not add two styles on the same inputbox so i guess that javascript
is the only solution?
If so, then how ?
Naw - just use the value attribute
<input name="fItem" type="text" id="fItem"
style="border:hidden" size="80"
maxlength="60" border="0"
value="Hello world" />

And if you need more styles, separate them with semicolons.

..
Sep 24 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: news.microsoft.com | last post by:
hey all, I am having an odd problem with the InputBox in VB.NET, and it ONLY happens on one of my computers. When I try "Dim x as String = InputBox("TESTPROMPT"), I get the following error: ...
2
by: missimaths | last post by:
I was wondering if anyone knew of a way to control the text a user types into an inputbox? I want the user to type in four letters only. I can check the lenght by using the len() function in vba...
1
by: Hans Kamp | last post by:
How do I use InputBox? private void addButton_Click(object sender, System.EventArgs e) { string newName; newName = InputBox("t1", "t2", "t3"); namesListBox.Items.Add(newName); }
1
by: | last post by:
When trying to use the InputBox function I get the error "InputBox is a namespace and therefore is not a valid expression". Can anyone tell me what the problem is? Thanks.
7
by: portroe | last post by:
How can you populate an array using an inputbox(es)? thanks portroe
3
by: jcrouse | last post by:
Here is my code: Private Sub cmP1JoyUpLabelSize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmP1JoyUpLabelSize.Click lblP1JoyUp.Width = InputBox("Enter the Width of...
8
by: about:mozilla | last post by:
I'm just a newbie in vb.net and I have this terrible problem. I want to use inputbox to get number. -User can give numbers starting from 0 -If cancel is pressed then default number stays -If text...
2
by: MLH | last post by:
HowManyMore = InputBox(MyString, "How Many More?", "3") The above line results in an InputBox displaying that has an X button in the upper right corner. And next to it, there's a ? button (for...
8
by: jpoquette | last post by:
I have recently upgraded a Visual Basic 2003 win forms application to 2005. After doing so I can no longer get my project to compile. The code is bombing on any line that uses an InputBox. I'm...
0
by: insight_find | last post by:
I would like to check the user input into an inputbox in vb.net 2003. The inputbox in my program assigns the input from the inputbox into an array called get_grades which takes in students grades...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...
0
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
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,...

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.