In both IE9 and FF.
I have two php routines in a web page. Both are alike except variables. Both will output the HTML <options> for <select> in both routines. Have verified the source at the browser for both. But the first one is not displaying.
The correct HTML code is in the browser and have saved it as a htm file. Running this file, the web page does display correctly, with the proper 'selected' option.
first one not working: -
<tr>
-
<td align="left">State/Province
-
<span id="star">*</span>
-
</td>
-
<td align="left">
-
<div id="shipping_to_state_div" style="float:left">
-
<select id="shipping_to_state_prov" name="shipping_to_state_prov">
-
-
<?php
-
$sql = "SELECT * FROM state WHERE country='".$country."'";
-
$data_assoc_array = $db->getQuery($sql);
-
$data_num_rows = $db->num_rows;
-
echo '<option value="">Select State_Prov</option>';
-
for( $indx = 0; $indx < $data_num_rows; $indx++ )
-
{
-
echo '<option value="'.$data_assoc_array[$indx]['ID'].'"';
-
-
if( $data_assoc_array[$indx]['ID'] == $shipping_to_state_prov )
-
{
-
echo ' selected';
-
}
-
echo ' >'. $data_assoc_array[$indx]['title']. '</OPTION>'."\n";
-
}
-
?>
-
</SELECT>
-
</div>
-
</td>
-
</tr>
-
Second one working: -
<tr>
-
<td align="left">State/Province
-
<span id="star">*</span>
-
</td>
-
<td align="left">
-
<div id="shipping_to_state_div" style="float:left">
-
<select id="shipping_to_state_prov" name="shipping_to_state_prov">
-
<?php
-
$sql = "SELECT * FROM state WHERE country='".$country."'";
-
$data_assoc_array = $db->getQuery($sql);
-
$data_num_rows = $db->num_rows;
-
echo '<option value="">Select State_Prov</option>';
-
for( $indx = 0; $indx < $data_num_rows; $indx++ )
-
{
-
echo '<option value="'.$data_assoc_array[$indx]['ID'].'"';
-
-
if( $data_assoc_array[$indx]['ID'] == $shipping_to_state_prov )
-
{
-
echo ' selected';
-
}
-
echo ' >'. $data_assoc_array[$indx]['title']. '</OPTION>'."\n";
-
}
-
?>
-
</SELECT>
-
</div>
-
</td>
-
</tr>
-
7 3233 zmbd 5,501
Recognized Expert Moderator Expert
bajaexplorer:
And just what exactly is "not working" in the first code vs. the second block of code. What errors (if any)? What is it you want the code to do?
I thought I explained it very well.
Neither EI9 nor FF is displaying the HTML code generated by one of the PHP routine. There are two PHP routines, both alike except for the variables.
Looking at the source code in browser, the <select> <options> and 'selected' are there for both routines. But one of them is not display in the browser.
in other words: -
<select id="state_prov" name="state_prov">
-
<option value="">Select State_Prov</option>
-
<option value="32" >Alabama</OPTION>
-
<option value="73" >South Dakota</OPTION>
-
<option value="74" selected >Tennessee</OPTION>
-
<option value="75" >Texas</OPTION>
-
</SELECT>
-
<
None of it is being shown in one of the two fields in the browser.
Even tho this is what is in for browser source.
The web pages two columns only have one that is display the state 'Tennessee'.
Rabbit 12,516
Recognized Expert Moderator MVP
I thought you said they were mostly the same except for the variable names? But when I look at the two code samples you posted, the variables are the same as well. Are you sure you posted the right code?
Yes, I copied the wrong one. Forgive me for that.
But what gets me, is why is it in the browser as HTML correctly, but still will not display.
Like I had mentioned, if i save that source from the browser and click on the htm file of it. It pops up showing correctly.
If this was any other app, I would think I had a race condition. -
<tr>
-
<td align="left">State/Province:<span id="star">*</span></td>
-
<td align="left">
-
<div id="state_div" style="float:left">
-
<select id="state_prov" name="state_prov">
-
<?php
-
$sql = "SELECT * FROM state WHERE country='".$country."'";
-
$data_assoc_array = $db->getQuery($sql);
-
$data_num_rows = $db->num_rows;
-
echo ' <option value="">Select State_Prov</option>';
-
for( $indx = 0; $indx < $data_num_rows; $indx++ )
-
{
-
echo '<option value="'.$data_assoc_array[$indx]['ID'].'"';
-
-
if( $data_assoc_array[$indx]['ID'] == $state_prov )
-
{
-
echo ' selected';
-
}
-
-
echo ' >'. $data_assoc_array[$indx] ['title']. '</OPTION>'."\n";
-
}
-
?>
-
</SELECT>
-
</div>
-
</td>
-
</tr>
-
Rabbit 12,516
Recognized Expert Moderator MVP
I don't see in your code how the variables $country, $shipping_to_st ate_prov, and $state_prov is being populated.
zmbd 5,501
Recognized Expert Moderator Expert
bajaexplorer
And that is why I asked the question I did... HTML is not one of the languages I use often; thus, I thought I had missed something.
My be columns your are calling is not exists. check the columns carefully in table of the database.
Secondly try selected="selec ted" instead of selected
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mike Turco |
last post by:
I have an Access database that holds a catalog and one of the fields
contains the HTML for the web page. The HTML code is very simple. I would
like to be able to display that HTML output on an access report. Is there
some kind of control that I can embed into the report so that I can see that
HTML?
Thanks,
Mike
|
by: Tomaz Koritnik |
last post by:
Hi
I have many short HTML files stored in a binary stream storage to display
descriptions for various items in application. HTML would be display inside
application using some .NET control or COM control (like Microsoft
WebBrowser). For each description there is one HTML file and along
description text, it contains links to related information. Clicking related
information would for example open new form in application and display some...
|
by: nesster13 |
last post by:
Dear All,
I am a new VB programmer and dont know very much about it so please
bare with me. Here is the situation. My professor gave us an e-commerce
website to work on but the problem is that he does all the Html and
code within one file. For example normally we create an ASP.net
application we will have the choice of doing the design in the design
view and the code in the code view. This was not the case, he did both
in the same file...
|
by: juan_mauricio_lopez |
last post by:
I built an html from a XML and a XSL transformation, now I need to parse the
html in order to get the input form the user but I’m not being able to
reference the HTML produced by the transformation (in order to get it and be
able to extract the user’s input)…
I have been struggling with this for a few days and I can’t find a way to
get a handle to the html code, any help or advice is very appreciated and
welcome.
Thanks.
|
by: Lucky |
last post by:
hi guys!
i've got very interesting problem. it is like this.
is it possible to get HTML generated by the server control in code
behind?
i'm developing an asp.net web application where i need to fectch data
in HTML format. The data is rendered by the Data Repeater in Table
format on webpage.
is there any way i can get reder data of data repeater from itself? i
| |
by: cttseng |
last post by:
Dear all,
I have a problem that how to get the page's source code
which is generated by javascript code?
For example:
http://grouper.com/video/south%2bpark
Although I can see the result page which contains pic and
description of each video. But when I see the source html code,
I just can see the section is generated by javascript function.
|
by: Doug (dtism) |
last post by:
Hello **newbie alert** <-- that's me btw, but you might have guessed
that by my topic title.
I have an html page that submits a name and email address by a form to
a page called preview.php
I'd like to do some basic validation on the credentials subbitted via
the form, and if they pass then send the credentials via email and
display the rest of the page (which will have links to download some
promotional tunes from my friends record...
|
by: LamSoft |
last post by:
I have a cell in the datagrid, which the original data is as following:
Testing1
Testing2
Testing3
Testing4
There are 4 lines, while it displays on the browser, it shows as a line, and
I tried to replace "\r\n" to <br/>, but the smart ASP helps me to translate
<br/into "<br/> , so the <br/is useless here.... How can I do
|
by: Ned White |
last post by:
Is it possible to insert HTML codes to a textbox control ?
I am reading HTML formated string from sql server but if i assign this value
to Text property of TextBox, the format tags of HTML seems too...
sample string value from database:
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 11pt;
mso-bidi-font-weight: bold">
Sales Contract </SPAN></P>
<SPAN style="FONT-SIZE: 11pt; mso-bidi-font-weight: bold">Paragraph...
|
by: sateeshchandrasanga |
last post by:
Hi All,
My HTML code is working fine in Firefox.But its not displaying any thing in IE.Can you help me in this problem.And in Google crown its displaying but not properly.
contactus.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |