473,800 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

im using looping and yet it wont appear in my dropdown list

14 New Member
how can i appear the number 1,2,3-10. in the drop down menu??

i need ur advice and help as well.. pls do help me..

thank you very much for ur time and as well as yout help...

need it within 1day if its fine with you..
tankx.....
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. select name="level" id="level">
  3.    <option value="------------">---------------</option>
  4.  <?php 
  5.      //$i=$_POST['num'];             
  6.      for($i=1;$i<=10;$i++)
  7.     { ?>
  8.  <option<?php $i ?>> <?php printf '$i<br>\n"\'; ?></option>
  9.         <?php 
  10.           } 
  11.           ?>
  12.  
  13. </select>
  14. </html>
  15.  
Jan 11 '08 #1
11 1243
rpnew
188 New Member
how can i appear the number 1,2,3-10. in the drop down menu??

i need ur advice and help as well.. pls do help me..

thank you very much for ur time and as well as yout help...

need it within 1day if its fine with you..
tankx.....
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. select name="level" id="level">
  3.    <option value="------------">---------------</option>
  4.  <?php 
  5.      //$i=$_POST['num'];             
  6.      for($i=1;$i<=10;$i++)
  7.     { ?>
  8.  <option<?php $i ?>> <?php printf '$i<br>\n"\'; ?></option>
  9.         <?php 
  10.           } 
  11.           ?>
  12.  
  13. </select>
  14. </html>
  15.  
Hi,

Try this .........

[HTML]
<html>
<select name="level" id="level">
<option value="------------">---------------</option>
<?php
for($i=1;$i<=10 ;$i++)
{ ?>
<option value='<?php echo $i; ?>' > <?php printf ($i,'<br>\n\"') ; ?></option>
<?php
}
?>
</select>
</html>
[/HTML]

I've just changed line 2 and line 8 in your code(2 and 7 in mine).

In line 2 you have missed '<' (check the <select> statement).
In line 8, made a few changes.

And use the 'printf' statement accordingly so that you can get it in the format you want.
However the code which i've changed makes a DROPDOWN list with 1 to 10 starting with '---------------'.

Regards,
RP
Jan 11 '08 #2
rpnew
188 New Member
Hi,

Try this .........

[HTML]
<html>
<select name="level" id="level">
<option value="------------">---------------</option>
<?php
for($i=1;$i<=10 ;$i++)
{ ?>
<option value='<?php echo $i; ?>' > <?php printf ($i,'<br>\n\"') ; ?></option>
<?php
}
?>
</select>
</html>
[/HTML]

I've just changed line 2 and line 8 in your code(2 and 7 in mine).

In line 2 you have missed '<' (check the <select> statement).
In line 8, made a few changes.

And use the 'printf' statement accordingly so that you can get it in the format you want.
However the code which i've changed makes a DROPDOWN list with 1 to 10 starting with '---------------'.

Or anything else get back here.

Regards,
RP
Jan 11 '08 #3
annerhexian
14 New Member
hi!

thank u so much for ur help..
it heps a lot on my project..
Jan 11 '08 #4
annerhexian
14 New Member
hi it was appear already but my problem is when i updated it using this code:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3. <select name="level" id="level">
  4.             <option value="------------">---------------</option>
  5.             <?php
  6.           for($i=1;$i<=10;$i++){
  7.           ?>
  8.             <option <?php if(!strcmp($row['num'],$i)) echo 'selected="selected"'; ?>><?=$i?></option>
  9.           <?php 
  10.           } 
  11.           ?>
  12.              </select>
  13. </html>
  14.  
it will just give a blank output on it when i went to the update profile? wats wrong with my code im using? i tried to fetch the code on it.. like for example i tried to get number 2 when i updated it the 2 didnt appear..

i wish u cud help me on this part....

tanx for the help as always...
Jan 11 '08 #5
annerhexian
14 New Member
hi it was appear already but my problem is when i updated it using this code:

num is the field in a table called faculty which the databse is called ranking.
Code: ( text )
<html>
<select name="level" id="level">
<option value="------------">---------------</option>
<?php
for($i=1;$i<=10 ;$i++)
{
?>
<option
<?php if(!strcmp($row['num'],$i)) echo 'selected="sele cted"'; ?> ><?=$i> </option>
<?php
}
?>
</select>
</html>


it will just give a blank output on it when i went to the update profile? wats wrong with my code im using? i tried to fetch the code on it.. like for example i tried to get number 2 when i updated it the 2 didnt appear..

i wish u cud help me on this part....

tanx for the help as always...
Jan 11 '08 #6
rpnew
188 New Member
hi it was appear already but my problem is when i updated it using this code:

num is the field in a table called faculty which the databse is called ranking.
Code: ( text )
<html>
<select name="level" id="level">
<option value="------------">---------------</option>
<?php
for($i=1;$i<=10 ;$i++)
{
?>
<option
<?php if(!strcmp($row['num'],$i)) echo 'selected="sele cted"'; ?> ><?=$i> </option>
<?php
}
?>
</select>
</html>


it will just give a blank output on it when i went to the update profile? wats wrong with my code im using? i tried to fetch the code on it.. like for example i tried to get number 2 when i updated it the 2 didnt appear..

i wish u cud help me on this part....

tanx for the help as always...
Hi,
Can you explain it further?.... i'm afraid i didnt get you exactly.
what do you want to do? just explain a bit more.

Regards,
RP
Jan 14 '08 #7
annerhexian
14 New Member
Hi,
Can you explain it further?.... i'm afraid i didnt get you exactly.
what do you want to do? just explain a bit more.

Regards,
RP
hi sori about that... my problem here is like from another page to fetch from another page for updating.. for example you already inputted in the textbox1 which is 2 and when it was in the updated page it was not fetch.. pls do help me in that code if whats wrong with that.. why cant i fetch the looping variable to update it in the new page.. could you please give me some suggestions about it..
take for example like this:
texbox1 is 2 and i want to update the textbox1 into 4 and i couldnt fetch it and update it as well.

thank you for your time and as well as your help...
Jan 14 '08 #8
annerhexian
14 New Member
hi sori about that... my problem here is like from another page to fetch from another page for updating.. for example you already inputted in the textbox1 which is 2 and when it was in the updated page it was not fetch.. pls do help me in that code if whats wrong with that.. why cant i fetch the looping variable to update it in the new page.. could you please give me some suggestions about it..
take for example like this:
texbox1 is 2 and i want to update the textbox1 into 4 and i couldnt fetch it and update it as well.

thank you for your time and as well as your help...
Jan 14 '08 #9
annerhexian
14 New Member
hi sori about that... my problem here is like from another page to fetch from another page for updating.. for example you already inputted in the textbox1 which is 2 and when it was in the updated page it was not fetch.. pls do help me in that code if whats wrong with that.. why cant i fetch the looping variable to update it in the new page.. could you please give me some suggestions about it..
take for example like this:
texbox1 is 2 in the page1.php and i want to update the textbox1 into 4 in the updatedpage.php and i couldnt fetch the 2 in the textbox1 in the page1.php so that i could update it to 4 in the textbox1 in the updatedpage.php .

What will be the best way?

thank you for your time and as well as your help...


Take care my friend..
Jan 14 '08 #10

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

Similar topics

3
589
by: Jim Mitchell | last post by:
My Goal is to have a dropdown (DL2) filled from the selectIndexChange event of a primary dropdown (DL1). These are picklists that will be selected frequently. Can someone recommend a strategy that will not require the screen to refresh every time. 1) If I use HTML dropdown lists, how do I trigger a postback? 2) Can I load XML into the viewstate and use the viewstate data somehow? 3) Should I just bite the bullet and let the screen...
2
4448
by: Marc | last post by:
I'm back in the Access development mode and seem to have forgotten how to do 2 things that should be simple. I have a database with a table of contacts, companies and activities. The idea is that I'll put in a list of companies, a bunch of contacts that work at each company, and an activities form that allows me to input every activity I do for each contact. The activities table includes a lookup field (also named contactID) for...
0
240
by: Jonathan Wilson | last post by:
Firstly, to get msvcrt.lib, install the .NET framework SDK. The version of msvcrt.lib included there is the exact same one as comes with Visual Studio ..NET 2003. There are some other things that might be usefull (e.g. the debug version of msvcrt.lib) but msvcrt.lib is the most usefull thing. Secondly, install the latest version of the Microsoft Platform SDK. The "64-bit" compiler will provide versions of undname.exe, nmake.exe,...
4
1214
by: Paul | last post by:
Hi, noticed high activity on this newsgroup as the last few posts I have made have not received a response. Anyhow I noticed that with a .NET web application when the webform opens if the user hits the tab key it goes to the address bar at the top of the browser. I would like it to go to a control and have set the tab index to 0 and 1 but still goes to the address bar. Thanks. -- Paul G Software engineer.
2
4558
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was set to...it is set to false. Can someone show me what I am doing wrong and tell me the correct way? Thank you. In the page load event, I am doing the following:
5
11904
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My dropdown list control does not retain its SelectedValue. Unless I read the SelectedValue right after the control has been loaded, populated, and assigned with its original value (and of course that is
3
3527
by: er1 | last post by:
Hi all, I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query based on the values selected on both the dropdown lists. But this part is not working. It picks up right value for the first dropdown list and always takes the FIRST value of the second dropdown list. I am not sure how to make it use the selected value...
3
2806
by: fish919 | last post by:
Hello All, I am creating a date base in access. I want to create a dropdown list box that is connected to another dropdown list box. You start with a dropdown list that has 5 choices and each of these choices will call another dropdown list box when one of the choices from the first gets selected. (I hope this makes sense) All of this is being done on a single form. I know how to make a (sub) dropdown list not seen before the action...
3
2375
by: tddeffner | last post by:
I have a form i need to create that involves looping dropdowns in asp.net. The form sets a time in a open time and a close time dropdownlist for each weekday. So I need it to loop seven times. I need to change the id for each of the dropdowns for my vbscript to add up the hours of the day. How can I get this work with asp:dropdownlist?
0
9694
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, 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...
0
9553
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,...
1
10256
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10039
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6824
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4152
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
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2953
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 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...

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.