473,654 Members | 3,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

declare variable to pass to php

I have a check box on page 1 of an html page with no submit button.
There is a list of links that call a php display page from page 1.

I want to check the status of the check box from the display page but I
haven't found a way to pass the value without a submit function.

I have hunted in the help and the on line turorials etc but have found
nothing that helps.

Any suggestions on how to do this or links that will help me do it
appreciated.

Bert

Jul 17 '05 #1
4 1994
jn
"Bert" <be*********@me ckcom.net> wrote in message
news:SO******** ********@fe07.u senetserver.com ...
I have a check box on page 1 of an html page with no submit button.
There is a list of links that call a php display page from page 1.

I want to check the status of the check box from the display page but I
haven't found a way to pass the value without a submit function.

I have hunted in the help and the on line turorials etc but have found
nothing that helps.

Any suggestions on how to do this or links that will help me do it
appreciated.

Bert


One way:

Use Javascript to check the value of the checkbox. Have your links point to
a Javascript function that appends the value of the checkbox to the
querystring of your link. Then forward the user to that URL.
Jul 17 '05 #2
I noticed that Message-ID:
<Gw************ *********@twist er.tampabay.rr. com> from jn contained the
following:
One way:

Use Javascript to check the value of the checkbox. Have your links point to
a Javascript function that appends the value of the checkbox to the
querystring of your link. Then forward the user to that URL.


Another way:
Turn the links into image submit buttons
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3

Uzytkownik "jn" <us************ *************** *****@jasonnorr is.net> napisal
w wiadomosci news:Gw******** *************@t wister.tampabay .rr.com...
"Bert" <be*********@me ckcom.net> wrote in message
news:SO******** ********@fe07.u senetserver.com ...
Use Javascript to check the value of the checkbox. Have your links point to a Javascript function that appends the value of the checkbox to the
querystring of your link. Then forward the user to that URL.


Another way, stick the value into the cookie:

<html>
<head>
<script>

function set_cookie_valu e(checked) {
document.cookie = 'umlaut=' + ((checked) ? 'uberkool!' : '');
}

</script>
</head>
<body>
<input type="checkbox" id="umlaut" onclick="set_co okie_value(this .checked)">
<label for="umlaut">Ch eck me</label>
</body>
</html>
Jul 17 '05 #4
jn
"Chung Leong" <ch***********@ hotmail.com> wrote in message
news:yc******** ************@co mcast.com...

Uzytkownik "jn" <us************ *************** *****@jasonnorr is.net> napisal w wiadomosci news:Gw******** *************@t wister.tampabay .rr.com...
"Bert" <be*********@me ckcom.net> wrote in message
news:SO******** ********@fe07.u senetserver.com ...
Use Javascript to check the value of the checkbox. Have your links point to
a Javascript function that appends the value of the checkbox to the
querystring of your link. Then forward the user to that URL.


Another way, stick the value into the cookie:

<html>
<head>
<script>

function set_cookie_valu e(checked) {
document.cookie = 'umlaut=' + ((checked) ? 'uberkool!' : '');
}

</script>
</head>
<body>
<input type="checkbox" id="umlaut"

onclick="set_co okie_value(this .checked)"> <label for="umlaut">Ch eck me</label>
</body>
</html>


That's a good idea.
Jul 17 '05 #5

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

Similar topics

6
677
by: David T. Ashley | last post by:
Hi, In my project, I typically declare and define variables in the .H file, i.e. DECMOD_MAIN UINT8 can_message_201_status_global #ifdef MODULE_MAIN = HAS_NEVER_BEEN_RECEIVED #endif ;
10
4381
by: Simon | last post by:
I'm a js newbie trying to use some very simple js to call an ActiveX object's methods. I need to use a pointer to call an embedded ActiveX object's method to receive a number. As I understand it, js is typeless so how can I get a variable to be a pointer type? Passing var i as the parameter gets an undefined value in return. Thanks IA, Simon
6
19053
by: rick | last post by:
Noob problem. I prefer to keep all my scripts in an external '.js' file. I am currently loading the external '.js' file from the header. Problem is I would like to declare a global variable in the external file, but I keep getting an error about the object does not exist. Can someone tell me where or how to declare a global variable in an external file that is available after the page is loaded.
5
33077
by: MMSJED | last post by:
I am beginner in using C#, actually I am trying to move from VB6 to C# I need very small help in programming problem my be you will laugh when you get it That simply I have to form let’s say Form1 (main form) and Form2, there is parameter in form2 I have to called from form1. So please would you tell me how? Any way thanks
41
10657
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query = String.Format("SELECT * FROM dbo.documents WHERE ") & query End Sub
8
10159
by: redefined.horizons | last post by:
I would like to have an array declaration where the size of the array is dependent on a variable. Something like this: /* Store the desired size of the array in a variable named "array_size". */ unsigned short int array_size = 25; /*Declare an array named "numbers" using the variable initialized above. */ unsigned short int numbers;
1
2779
by: ares.lagae | last post by:
- I have a typelist and I want to declare a member variable for each of the types. How can I do that? E.g. I have the typelist "typedef boost::mpl::vector<int, float> types;" and I want to declare member variables with type "int" and "float". - I have a typelist and I want to declare a variable based on each of the types types. How can I do that? E.g. I have the typelist "typedef boost::mpl::vector<int, float> types;" and I want to...
0
8304
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new records there is an error "Incorrect syntax near '-'. Must declare the scalar variable "@UserName". I worked out in design view,code is automatically generated.Iam not able fix the error. Iam working with Visual Web Developer-2005 Express Edition
4
2735
by: macneed | last post by:
how can i declare a variable inside a if case? if(today != recordday) { string NewRecordOfToday; } .. other work... .. .. if(today != recordday)
1
8276
by: Tony M | last post by:
vs 2005 - vb .net - web forms - xp pro Can't figure out why I keep getting the error Must declare the scalar variable "@CheckUser". The error happens on SqlDA.Fill(SqlDS). Just trying to make sure EMail address doesn't exist in database before I insert data. Connection string and everything else is correct. If I use Dim SQL = "Select * from Clients where EMail = " & chr(39) & "SomeEmailAddress@msn.com" & chr(39) it works fine.
0
8294
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,...
0
8816
Oralloy
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...
0
8709
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8494
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
8596
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
7309
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, 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...
0
5627
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();...
1
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1597
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.