473,378 Members | 1,498 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,378 software developers and data experts.

Displaying text boxes from a check box

I want to make visible two or more text boxes once a user has ticked
a checkbox. I know javascript will come in here, but am a newbie.
However, I want to maintain the variables and move them back to PHP
for updating in the relevant tables. Can anyone please give me ideas.
Mar 7 '08 #1
4 1368
On Mar 7, 9:53 am, chima...@googlemail.com wrote:
I want to make visible two or more text boxes once a user has ticked
a checkbox. I know javascript will come in here, but am a newbie.
However, I want to maintain the variables and move them back to PHP
for updating in the relevant tables. Can anyone please give me ideas.
this?
<?
if (isset($_POST['field'])){
?>
<textarea name="textarea" id="textarea" cols="45" rows="5"></textarea>
<?
}
?>
Mar 7 '08 #2
ch******@googlemail.com wrote:
I want to make visible two or more text boxes once a user has ticked
a checkbox. I know javascript will come in here, but am a newbie.
However, I want to maintain the variables and move them back to PHP
for updating in the relevant tables. Can anyone please give me ideas.
As you said, you need javascript to do it. Try a javascript newsgroup
such as comp.lang.javascript.

All PHP sees is what's submitted in the request. It doesn't matter how
that data is generated.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Mar 7 '08 #3
On Fri, 07 Mar 2008 13:53:03 +0100, <ch******@googlemail.comwrote:
I want to make visible two or more text boxes once a user has ticked
a checkbox. I know javascript will come in here, but am a newbie.
However, I want to maintain the variables and move them back to PHP
for updating in the relevant tables. Can anyone please give me ideas.
Appearing and disappearing is one for javascript indeed, so ask that in
comp.lang.javascript. I'd say both text inputs are in a container with
display=none, so the inputs are always in the form.

For this HTML fragment:
<input name="updatechecktexts" type="checkbox"
onclick="someFunctionToShowInputs(this.checked);">
<div id="hidden_block" style="display:none;">
<input name="text1" value="foo">
<input name="text2" value="bar">
</div>

The receiving PHP code would be:
if(isset($_POST['updatechecktexts'])){
//do something with $_POST['text1'] & $_POST['text2']
}

.... and make sure your page works with javascript OFF.
--
Rik Wasmus
Mar 7 '08 #4
ch******@googlemail.com wrote:
I want to make visible two or more text boxes once a user has ticked
a checkbox. I know javascript will come in here, but am a newbie.
However, I want to maintain the variables and move them back to PHP
for updating in the relevant tables. Can anyone please give me ideas.
Ask in comp.lang.javascript. This is a standard javascript operation.
First, though, look in google with words such as
javascript toggle visible
Many solutions are already published.
Mar 7 '08 #5

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

Similar topics

1
by: Nick | last post by:
Hey, Needed some pointers on how I can get to display pop up bubbles in a windows form that I am building. I basically require these as tooltips for a user. I'm currently planning to call the...
3
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where...
3
by: duncan | last post by:
I have a text box on a web form here is the HTML for it :- <asp:textbox id="winPts" style="LEFT: 170px; POSITION: absolute; TOP: 80px" runat="server" Width="24px" maxlength="2"></asp:textbox> ...
5
by: Bill | last post by:
Hello, Could anyone post some simple code or advise me on how I can display the SSN number like *****7890 in a text box, even thought the user entered 1234567890, and the value of the variable...
2
by: moumita | last post by:
I have the folowing code..the logic according to me is correct..but I dont know...the msg boxes are not displaying anything...am I supposed to change any settings ??? Public Class Form1
7
by: Demonicpagan | last post by:
I have this form where I am trying to place items from checked boxes into a text box. An image of what this form looks like is at http://www.stelth2000inc.com/images/screen.png Here is some...
0
by: Chris Davoli | last post by:
Environment - Win XP Pro, VS2005, ASP.Net. I'm able to put Panels on a web page and they work just fine, but the problem comes in on when I want to look at the web page in DESIGN mode in VS2005....
0
by: Scott | last post by:
Hello all and thanks in advance for any help you may be able to offer me. I am quite new to asp.net and am trying to work with a datagrid but am having some problems with it. Here's the...
1
by: jerger | last post by:
I have not made a program or page from start yet. I have made modifications to our signoff asp pages like changing the questions, texts, shortening field lengths etc... I also have copied the files...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.