473,395 Members | 1,762 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.

how to generate a title automatically

i have created a drop down list that has the code no. of a subject. now i want that after a user select a code no the title corresponding to that code no. will automatically displayed in the title field.
How can i do this ?
Feb 26 '07 #1
4 1094
xwero
99
i have created a drop down list that has the code no. of a subject. now i want that after a user select a code no the title corresponding to that code no. will automatically displayed in the title field.
How can i do this ?
i think you nean something like this

[PHP]
<form action="<?php echo $PHP_SELF; ?>" >
<select name="test">
<option value="1">test 1</option>
<option value="2">test 2</option>
<option value="3">test 3</option>
<option value="4">test 4</option>
</select><br>
<input type="submit" name="send" value="send">
</form>
<?php
if($_POST['send']){
echo $_POST['test'];
}
?>
[/PHP]

This will display the values of the dropdown.
Feb 26 '07 #2
i think you nean something like this

[PHP]
<form action="<?php echo $PHP_SELF; ?>" >
<select name="test">
<option value="1">test 1</option>
<option value="2">test 2</option>
<option value="3">test 3</option>
<option value="4">test 4</option>
</select><br>
<input type="submit" name="send" value="send">
</form>
<?php
if($_POST['send']){
echo $_POST['test'];
}
?>
[/PHP]

This will display the values of the dropdown.
I dont mean that. I had created a table in database which has code no. and title of that code no. Now I had called the code no. in a drop down list. I want that when a user select a code no the title correspoding to that code displays in the title field. how can i do this?
Feb 27 '07 #3
xwero
99
I dont mean that. I had created a table in database which has code no. and title of that code no. Now I had called the code no. in a drop down list. I want that when a user select a code no the title correspoding to that code displays in the title field. how can i do this?
In the titlefield of the page?
Feb 27 '07 #4
devsusen
136 100+
Hi,

I think you need to use javascript for this. I am putting a simple example for this bellow.

Expand|Select|Wrap|Line Numbers
  1. <html><head><title>title test</title>
  2. <script language="javascript">
  3. function fan()
  4. {
  5. var k = document.forms[0].aa[document.forms[0].aa.selectedIndex].value;
  6. document.title = k;
  7. }
  8. </script>
  9. </head>
  10. <body>
  11. <form>
  12. <select name="aa" onChange="fan()">
  13. <option value="1111">1111</option>
  14. <option value="2222">2222</option>
  15. <option value="3333">3333</option>
  16. </select></form>
  17. </body>
  18. </html>
Feb 27 '07 #5

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

Similar topics

3
by: Mike | last post by:
I am just wondering if it is possible to save a HTML string from PHPs? Let me elaborate more on what I mean. If you do <?php include 'abc.php' ?> //abc.php <html>
1
by: Tim:. | last post by:
Hi Can someone tell me how I generate a new XML file that I can then use with an XSLT file. I am trying to use an XML file generated from Microsoft Project or even better generate an XML file from...
1
by: muesliflakes | last post by:
I'm trying to generate a normalized XML document out of SQL server that reflects the data structure of a table. Eg. This is what I would like to get <table name='MtFeedback'> <field...
2
by: Matt | last post by:
Hello, I would like to generate what I call an "overall class hierarchy" in UML automatically derived from my C++ code source. An example of what I seek: ...
14
by: Paul | last post by:
I want to set the page title and/or a form hidden field programatically through ASP.Net. I do not want to use something like... <% sTitle ="My Title" %> <html><title><%=sTitle%></title>..... ...
0
by: Avon | last post by:
Hi friends, I am very sorry for my not perfect English. I have one question, I am using David Bauer's DynamicControlsPlaceholder to dinamically generate controls and I am tryig to generate...
2
by: Van den Driessche Willy | last post by:
I am writing a HTTP Module to generate an RSS feed for certain requests. For the moment everything is hardcoded and my code looks like (the idea is - for the moment to generate the RSS feed on the...
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
6
by: er | last post by:
hi, here's why i'm trying to do: header1.hpp namespace{ struct A{};} struct B1{ A a; }; header2.hpp namespace{ struct A{};}
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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.