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

Submit from a checkbox that is not in a form

FP
I have a list of results. When the user clicks a checkbox I need it to
update the database but I don't want it to reload the current page.
Currently I have the following;
- a checkbox in a form
- the record ID as a hidden value in the form
- using onclick to open a new window
- form targets new window
- new window closes itself

Aside from the window flickering by this works well. The problem is
the form is taking up more space than I want it to so can I due the
same thing but without having to put the checkbox in a form?

Jul 18 '06 #1
5 2045
FP said the following on 7/18/2006 5:05 PM:
I have a list of results. When the user clicks a checkbox I need it to
update the database but I don't want it to reload the current page.
OK, then don't.
Currently I have the following;
- a checkbox in a form
- the record ID as a hidden value in the form
- using onclick to open a new window
- form targets new window
- new window closes itself
Use a hidden IFrame, target the IFrame, nothing "flickers" and you don't
run into popup blockers.
Aside from the window flickering by this works well.
Then I wouldn't consider it "works well".
The problem is the form is taking up more space than I want it
to so can I due the same thing but without having to put the
checkbox in a form?
Nothing in that question makes sense. On the page itself, display wise,
this code:

<form name="myForm" action="something" target="myIFrame">
<input type="checkbox">
<input type="hidden" name="hiddenInput">
</form>

Takes up no more "room" than this does:

<input type="checkbox">
<input type="hidden" name="hiddenInput">

The fact that it is in a form actually makes life easier on you.

Another alternative is to set the src property of an image Object using
the data to be posted as a queryString.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 18 '06 #2
FP
Randy Webb wrote:
FP said the following on 7/18/2006 5:05 PM:
I have a list of results. When the user clicks a checkbox I need it to
update the database but I don't want it to reload the current page.

OK, then don't.
This is where I was hoping to get some help from the group.
Use a hidden IFrame, target the IFrame, nothing "flickers" and you don't
run into popup blockers.
I never heard of them before, I'm currently looking at an online
tutorial on how to use them.
The problem is the form is taking up more space than I want it
to so can I due the same thing but without having to put the
checkbox in a form?

Nothing in that question makes sense. On the page itself, display wise,
this code:

<form name="myForm" action="something" target="myIFrame">
<input type="checkbox">
<input type="hidden" name="hiddenInput">
</form>

Takes up no more "room" than this does:

<input type="checkbox">
<input type="hidden" name="hiddenInput">
I'm using Safari 1.3.1 on OS X 10.3.9
In the html code I'm displaying a line of text, the checkbox on the
next line, then a comments field. If the checkbox is in a form a 1/2
inch gap appears between the checkbox and comment line. If the
checkbox is not in a form that gap disappears. I assumed this was
consistent behavior between browsers, based on your comment I guess it
isn't. Regardless I would still like for that 1/2 inch gap to
disappear in Safari. The exact code I'm using is:

Gap is there;
<form id="FlagDone" method="post" action="done.php" target="WinDone">
<input type="hidden" name="TheRecID" value="<?PHP RecID ?>">
<P ALIGN=right><FONT SIZE="+1" COLOR="#666666">Done:</FONT>
<INPUT TYPE=checkbox NAME="Done" VALUE="1" onclick="FCDone();">
</P></form>

No gap;
<input type="hidden" name="TheRecID" value="<?PHP RecID ?>">
<P ALIGN=right><FONT SIZE="+1" COLOR="#666666">Done:</FONT>
<INPUT TYPE=checkbox NAME="Done" VALUE="1" onclick="FCDone();">
</P>

Jul 18 '06 #3
FP wrote:
I'm using Safari 1.3.1 on OS X 10.3.9
In the html code I'm displaying a line of text, the checkbox on the
next line, then a comments field. If the checkbox is in a form a 1/2
inch gap appears between the checkbox and comment line.
Try this:

<form style="margin: 0; padding: 0;" ...>

Adding that inline CSS will remove any margin or padding that's being
applied to the form, which is what's causing the gap.

You could also do this globally in an external stylesheet, which is a
more graceful method. But that's outside the scope of this group; read
a CSS tutorial to get started.

Jeremy
Jul 19 '06 #4
FP wrote:
Randy Webb wrote:
>FP said the following on 7/18/2006 5:05 PM:
>>I have a list of results. When the user clicks a checkbox I need
it to update the database but I don't want it to reload the current
page.

OK, then don't.

This is where I was hoping to get some help from the group.
>Use a hidden IFrame, target the IFrame, nothing "flickers" and you
don't run into popup blockers.

I never heard of them before, I'm currently looking at an online
tutorial on how to use them.
>>The problem is the form is taking up more space than I want it
to so can I due the same thing but without having to put the
checkbox in a form?

Nothing in that question makes sense. On the page itself, display
wise, this code:

<form name="myForm" action="something" target="myIFrame">
<input type="checkbox">
<input type="hidden" name="hiddenInput">
</form>

Takes up no more "room" than this does:

<input type="checkbox">
<input type="hidden" name="hiddenInput">

I'm using Safari 1.3.1 on OS X 10.3.9
In the html code I'm displaying a line of text, the checkbox on the
next line, then a comments field. If the checkbox is in a form a 1/2
inch gap appears between the checkbox and comment line. If the
checkbox is not in a form that gap disappears. I assumed this was
consistent behavior between browsers, based on your comment I guess it
isn't. Regardless I would still like for that 1/2 inch gap to
disappear in Safari. The exact code I'm using is:

Gap is there;
<form id="FlagDone" method="post" action="done.php" target="WinDone">
<input type="hidden" name="TheRecID" value="<?PHP RecID ?>">
<P ALIGN=right><FONT SIZE="+1" COLOR="#666666">Done:</FONT>
<INPUT TYPE=checkbox NAME="Done" VALUE="1" onclick="FCDone();">
</P></form>
try to add this to your form element:

style="margin-bottom:0px;

--
Dag.

style="margin-bottom:0px;
Jul 19 '06 #5
FP
Jeremy wrote:
Try this:
<form style="margin: 0; padding: 0;" ...>
Thanks, that fixed the problem in Safari.
Just had a look at the site from Netscapte & IE, yikes its ugly!
I got a lot of work to do to try to make this lign up.

Jul 19 '06 #6

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

Similar topics

4
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field...
2
by: Matt | last post by:
In the following code, I have 2 questions regarding submit button with image. 1) Does this code <input type="image" name="populate" src="populate.gif"> behave the same as an HTML submit button...
3
by: David Gonneau | last post by:
I'm getting an incredible behaviour of internet explorer. I have a generated html page with one form and many input of checkbox type. Those checkbox are grouped in 4 lists and each list of...
6
by: Tony R | last post by:
I need to make a submit button turn invisible when a checkbox is not clicked, and visible when it is clicked....I can't figure out a cross-browser way of doing this. Can anyone help?
4
by: Benny Ng | last post by:
Dear All, <input type="checkbox" name="chkAgreement" value="0">I agree with the above terms and conditions <asp:ImageButton ID="ImgBtnSubmit" Runat="server" CausesValidation=True...
1
by: sam | last post by:
Hi All, I have a form with 4 checkboxes and 4 text boxes and one submit button. The form should work such a way when I select a particular checkbox and give a url in text box, the form should...
2
by: somaskarthic | last post by:
Hi In my php code , i dynamically created table rows on button click event. Each row contain 3 selectboxes, 7 checkboxes . On each click of these elements i need to submit the form and save the...
1
by: vidgraph | last post by:
I have this great popup survey that slides in, then exits after the submit button is clicked. However, clicking the button doesn't give me any information about the visitor's answers. I inquired to...
1
by: arggg | last post by:
I created a submit form that calls a javascript:AjAX Command that will call the data and submit it without have the page refresh. This works perfect in Firefox however in IE and Opera when the...
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:
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
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
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,...
0
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...
0
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...

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.