LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-25-2015, 07:44 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
html form - Unable to have 2 form 'submit' on same line.


There is a lot of posts on the net advising a couple of solutions but nothing works in my case, I suspect it is due to the surrounding code but I cannot figure out what.
Toggling visibility works very well and the script works with 2 "submit" but renders correctly (as intended) only with one "submit" button. The 2 "submits" (lines 27, 28) do not render on the same line or within the block (as I want) no matter what I do (there is 4 lines within which they can both render).
There is hundreds of lines of
Quote:
'class"correctit" id="nnnn"
in this html document in one single HTML FORM. Each of these lines is a block element (<h2><h3><p> or similar) and need 2 submit buttons to be presented as a "wiki" as intended by code below. One "submit" is to submit a correction while the second submit is to report vandalism or similar. In this testing script href is to "#top" but will be to "#0001" (or incremental number) when it works.

Code:
1 <!DOCTYPE ....><html><head><title><link rel=stylesheet type="text/css" href="css.css">
2 <script type="text/javascript">
3 function toggle_visibility(id) {
4  var e = document.getElementById(id);
5   if(e.style.display == 'none')
6    e.style.display = 'block';
7   else
8    e.style.display = 'none';
9 }
10 </script>
11
12 </head><body><form method="post" action="cgi-bin/correct_line.cgi">
13
14 <div class="ven"><a name="top"></a>
15 <div>
16 <span class="hh2">
17      This is one description.
18 </span><span class="correctit"><a href="#top" name="top" onclick="toggle_visibility('0001');">mauvais?</a>
19 </span><br>
20
21 <span class="correctit" id="0001" style="display:none;">
22  En anglais: This is the description.<br><br>
23  Traduction correcte en francais:
24  <p>
25   <textarea class="watsleft"  placeholder="Certaines instructions." name="0001" rows="1" cols="80">
26   </textarea>
27 <!--   <input type="submit" value="Rapporter?"> -->
28   <input type="submit" value="Changez">
29   </p>
30 </span>
31 </div>
32
33 more of the same
34
35 </div></form>
36
37 and here is the css code
38
Code:
.correct_submit {
39 /*	display:inline;*/
40 	display:table-cell;
41 	text-align : left;
42 }
43 
44 .watsleft {
45 /*	width:80;	*/
46 	width: auto;
47         text-align : left;
48   	overflow: auto;		/* no scroll for IE */
49 }
50
51 .correctit {
52 	width: 100;
53	color:  #2F4F4F;
54 	background: #CCFFFF;
55         margin-left : 0px;
56 	font-size: 10px;
57 }
58 
59 .hh2	{
60         border : none;
61         margin-left : 12px;
62         margin-right : 4px;
63         text-align : left;
64 	color: green;
65 	font-size: 24px;	/* size is equal to <h2> */
66 }
Can anyone make a suggestion?

Thank you for your help.

Last edited by rblampain; 11-25-2015 at 07:53 AM.
 
Old 11-25-2015, 10:53 AM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
I'm not clear about what your "wiki" page should look like, but adding "%" to the width field for ".correctit" in what you posted renders the buttons on the same line:
Code:
 .correctit {
 	/*width: 100;*/
        width:100%;
	color:  #2F4F4F;
 	background: #CCFFFF;
        margin-left : 0px;
 	font-size: 10px;
 }
Attached Thumbnails
Click image for larger version

Name:	rblampain.jpg
Views:	33
Size:	80.9 KB
ID:	20126  
 
1 members found this post helpful.
Old 11-26-2015, 02:06 AM   #3
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
The percent sign was there, the forum "swallows" it unless one is in "advanced", this has happened before. I checked my code was correct which it is and I still have exactly the same problem. There was a few errors in the code according to w3c, one being a textarea within a <p></p> which is valid code according to my book, w3c did not accept 'placeholder="" ' within <textarea> or the container holding "textarea" but corrections and changes make no difference. There must be a difference between your test and mine outside of the code mentioned above. The result you show in your screenshot is what I need. Various browsers give the same result with the second "submit" rendering outside of its expected zone. Any suggestion welcome.
 
Old 11-26-2015, 09:57 PM   #4
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
The rendering is reasonable as it is (on two separate lines) and I think I will use the code as is for a while.
Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
html form with multiple submit button schlabs General 2 11-10-2007 11:56 AM
Submit web form from command line? dbc001 Linux - Networking 2 10-15-2006 03:59 AM
Can I "submit" an HTML <Form> with Javascript? nickiv Programming 3 06-13-2005 06:41 AM
shell script works form command line but not form crontab saifee General 1 10-14-2004 10:27 AM
how do I copy a whoel folder form one directory to another form the command line? zwyrbla Linux - Newbie 8 08-24-2004 06:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration