value from <input> is not displayed

J

Jivanmukta

I created HTML document. It is valid (http://validator.w3.org, HTML
Strict). I cannot give you the link because it's localhost only.
Problem: Value from <input> is not displayed.
I have a form:
<form name="announcement" action="submit_announcement.php"
method="POST">
with a text filed:
<input type="text" id="property_town" name="property_town" cols="25"
maxlength="25" style="width: 25ex" value="String"
onblur="validateText
(this);">
The problem is that String is not displayed (empty box).
Other fields in the form are displayed correctly.
I don't know what's wrong.
Please help.
 
J

Jukka K. Korpela

Jivanmukta said:
I created HTML document. It is valid (http://validator.w3.org, HTML
Strict). I cannot give you the link because it's localhost only.

I have an answer but cannot give it to you since it is in my local brain
only. Seriously, you could easily have uploaded the document on some web
server.
Problem: Value from <input> is not displayed.

On which browser(s)?
I have a form:
<form name="announcement" action="submit_announcement.php"
method="POST">
with a text filed:
<input type="text" id="property_town" name="property_town" cols="25"
maxlength="25" style="width: 25ex" value="String"
onblur="validateText
(this);">

It is not valid under any published HTML DTD, as they do not allow a
cols="..." attribute for an <input> element. Funnily enough, the W3C
validator gives the rather absurd error message
Attribute "COLS" is not a valid attribute. Did you mean "cols"?
The problem is that String is not displayed (empty box).

Tested on IE 8, within a minimal HTML markup, the value is displayed as
expected.
I don't know what's wrong.

It's in some part of the page that you didn't disclose. Maybe on line 42,
but I cannot see it sharply enough in my crystal ball.

It could be in your style sheet, or in JavaScript code.
 
J

Jivanmukta

Problem: Value from said:
On which browser(s)?

IE, FF.
It's in some part of the page that you didn't disclose. Maybe on line 42,
but I cannot see it sharply enough in my crystal ball.
It could be in your style sheet, or in JavaScript code.

Do you think so? Is it possible? My document passes W3C validation...
 
A

Adrienne Boswell

Gazing into my crystal ball I observed Jivanmukta
IE, FF.


Do you think so? Is it possible? My document passes W3C validation...

Again, since you didn't provide a URL we have no way of knowing _where_
the problem is. Put what you have on a server somewhere and come back
with a URL.
 
J

Jonathan N. Little

Adrienne said:
Gazing into my crystal ball I observed Jivanmukta


Again, since you didn't provide a URL we have no way of knowing _where_
the problem is. Put what you have on a server somewhere and come back
with a URL.

Gee anther "Snipe" hunt!
 
J

Jonathan N. Little

Adrienne said:
Gazing into my crystal ball I observed "Jonathan N. Little"

Thank you. I had to look that up. Learn something new every day.

Hmmm looks like I have to go hunting for the elusive "o"
 
J

Jivanmukta

Again, since you didn't provide a URL we have no way of knowing _where_
the problem is.  Put what you have on a server somewhere and come back
with a URL.

ftp://jivanmukta.za.pl/index.html
Look at string "Kielbasa" (value of input property_town). It appears.
Believe me or not but on this page at my localhost the string
"Kielbasa" is not shown!
I don't know what's going on.
 
G

GTalbot

ftp://jivanmukta.za.pl/index.html
Look at string "Kielbasa" (value of input property_town). It appears.
Believe me or not but on this page at my localhost the string
"Kielbasa" is not shown!
I don't know what's going on.

It's
http://jivanmukta.za.pl/index.html
and it has 45 validation markup errors:
http://validator.w3.org/check?uri=http://jivanmukta.za.pl/index.html

First thing to do:
fix all validation markup errors

Second, I strongly recommend that you remove all of the
style="width: ..ex;"
from your input type="text". Once you specified a size and a
maxlength, then there is no need to try to over-force the size of the
input. Just define the size (number of characters) and the maxlength.

You also need to examine/investigate what your onblur="validateText
(this);" actually does. Other text input have the same behavior too:

Ulica: <input type="text" id="property_street" name="property_street"
maxlength="30" size="30" style="width: 30ex" value="Lubicz"
onblur="validateText(this);">

and Lubicz is not shown in Konqueror 4.2.4.

Anyway, you really must start with fixing all the markup errors, then
removing width: ..ex on input type text.

Using Web Standards in your webpages
How to validate your page:
https://developer.mozilla.org/en/Us...Making_your_page_using_web_standards_-_how_to

regards, Gérard
 
J

Jan C. Faerber

I don't need debugging with Eclipse because value="Kielbasa" occurs in
source code preview of the browser. Thus, "Kielbasa" is generated
correctly by PHP.

Oh! I see. In Chrome it worked for me - in IE8 it didn't.
Snipping out >> onblur="validateText(this); <<
seems to solve the problem in IE.

I saw another form checker js which is invoked like this:
onClick="formcheck(document.formular.email.value)"
at the submit button.
Maybe you can find something similar with the whole form.

btw: 2 options marked with 'selected' in one menu is too much... (o;
<option value="" selected>(wybierz)</option>
<option value='12' selected>œl¹skie</option>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top