The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Existing form requires alteration
Buddy41
post Feb 12 2017, 07:02 AM
Post #1


Newbie
*

Group: Members
Posts: 10
Joined: 12-February 17
Member No.: 26,309



Hi,
Here is my form in question, http://www.theremotedoctor.co.uk/form-contact-new.html

The current working code has the text to the left of the trext box but i am looking to now put it above the text box.
Something so simple escapes me.

Please could you advise how i change/edit my code so the examples below can take affect.

Currently in use.

First Name * "text box is here"

I would now like,

First Name*
"text box is here"

Many thanks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Feb 12 2017, 10:19 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Just add a '<br>' tag after each <label>.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Buddy41
post Feb 12 2017, 10:27 AM
Post #3


Newbie
*

Group: Members
Posts: 10
Joined: 12-February 17
Member No.: 26,309



Hi,
Could you advise where as im adding where i think its correct but just pushing the fields etc down the page
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Buddy41
post Feb 12 2017, 11:04 AM
Post #4


Newbie
*

Group: Members
Posts: 10
Joined: 12-February 17
Member No.: 26,309



Hi,
Ive now sorted that but come unstuck with its input field.
Can you assist me please.

Check here http://www.theremotedoctor.co.uk/form-contact-new.html
Could you advise a sample of code so i could follow

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Feb 12 2017, 12:04 PM
Post #5


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Sorry, just noticed, you will never be able to do what you want because the <label> and <input> elements are in different <td>'s. You would have to redesign the form a little. What problem are you having?

Also, the 'for' attribute of the <label> element should point to the 'id' of the <input> element not the 'name' attribute.

This post has been edited by CharlesEF: Feb 12 2017, 12:10 PM
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 12 2017, 12:12 PM
Post #6


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



I think it should work if you change the rows with four columns...

CODE
<tr><br>
<td valign="top"><label for="first_name2">First Name *</label></td>
<td valign="top"><br><input  type="text" name="first_name" maxlength="50" size="25"></td>
<td valign="top"><label for="last_name">Last Name *</label></td>
<td valign="top"><br><input  type="text" name="last_name" maxlength="50" size="25"></td>
</tr>

...into two columns:

CODE
<tr>
<td valign="top">
    <label for="first_name2">First Name *</label>
    <br>
    <input  type="text" name="first_name" maxlength="50" size="25">
</td>
<td valign="top">
    <label for="last_name">Last Name *</label>
    <br>
    <input  type="text" name="last_name" maxlength="50" size="25">
</td>
</tr>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Buddy41
post Feb 12 2017, 01:26 PM
Post #7


Newbie
*

Group: Members
Posts: 10
Joined: 12-February 17
Member No.: 26,309



Thanks for the reply.
I am struggling with this,been all day doing what you currently see.
Are you able to assist me please.
I am stuck with the following items.
1,Start of label text to be inline vertically with its input box.
2,The form itself needs to be inline below where it reads "WEB CONTACT FORM" currently its within a huge blue area.
3,Centre Submit button to middle of message box.


Ive gone the 2 column route.
Many thanks guys.

This post has been edited by Buddy41: Feb 12 2017, 01:27 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 12 2017, 02:12 PM
Post #8


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



QUOTE(Buddy41 @ Feb 12 2017, 07:26 PM) *

1,Start of label text to be inline vertically with its input box.

I don't understand, how can they be inline when the INPUT is below the LABEL? unsure.gif

QUOTE
2,The form itself needs to be inline below where it reads "WEB CONTACT FORM" currently its within a huge blue area.

The blue area is the DIV with the CLASS "web-contact-form". If you want the WEB CONTACT FORM" heading inside that area too you can simply move it.

QUOTE
3,Centre Submit button to middle of message box.

It might appear to be off-center because the table is 650px wide, while its parent DIV with the CLASS "form-container" is only 615px, so the table spills out.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Buddy41
post Feb 12 2017, 02:15 PM
Post #9


Newbie
*

Group: Members
Posts: 10
Joined: 12-February 17
Member No.: 26,309



Hi,
Please see the form now,
http://www.theremotedoctor.co.uk/form-contact-new.html

Im getting there but slowly.
I need to create a little space below the inout field & the start of the label text below,as you can see its squashed.

The message box needs to be center of the form & also its label.

Thanks im getting there with your input.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Buddy41
post Feb 12 2017, 02:21 PM
Post #10


Newbie
*

Group: Members
Posts: 10
Joined: 12-February 17
Member No.: 26,309



Please see photo.
I am trying to get the text box equal to the edge of the form both sides as shown by green arrow.

The message box needs to be central like shown in red arrow.


Attached thumbnail(s)
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 12 2017, 02:34 PM
Post #11


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



QUOTE(Buddy41 @ Feb 12 2017, 08:15 PM) *

I need to create a little space below the inout field & the start of the label text below,as you can see its squashed.

You might use vertical CSS padding on the table cells, or add BR elements at the top of the table cells.

QUOTE
The message box needs to be center of the form & also its label.

Do the same as with the the submit button cell:

CODE
<td style="text-align: center" colspan="2">



User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 12 2017, 02:54 PM
Post #12


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



QUOTE(Buddy41 @ Feb 12 2017, 08:21 PM) *

Please see photo.
I am trying to get the text box equal to the edge of the form both sides as shown by green arrow.

You might use "text-align: right" on the right-column cells, but that will affect the label text as well.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Buddy41
post Feb 12 2017, 02:55 PM
Post #13


Newbie
*

Group: Members
Posts: 10
Joined: 12-February 17
Member No.: 26,309



Hi,
Here is my attempt but as you can see on the page now it right ?
<td style="text-align: center" colspan="2">
<textarea name="comments" maxlength="1000" cols="35" rows="10"></textarea>
</tr>
<tr>
<td colspan="2" style="text-align:center"><input type="submit" value="Submit">
</td>
</tr>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 12 2017, 03:30 PM
Post #14


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



QUOTE(Buddy41 @ Feb 12 2017, 08:55 PM) *

Hi,
Here is my attempt but as you can see on the page now it right ?

No, the page doesn't look like the above HTML. unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Buddy41
post Feb 12 2017, 03:31 PM
Post #15


Newbie
*

Group: Members
Posts: 10
Joined: 12-February 17
Member No.: 26,309



Im still trying to apply what you mentioned.
Can you paste here the code i need to use and where it needs to go
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Buddy41
post Feb 12 2017, 03:34 PM
Post #16


Newbie
*

Group: Members
Posts: 10
Joined: 12-February 17
Member No.: 26,309



Ok,
Ive just this second done it.
Now created an issue where the label and its boz have altered.
Can ypu advise the code so i can just add it in.

Thanks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Feb 12 2017, 03:41 PM
Post #17


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Instead of trying to center the elements in the <td> why not make the <input> elements expand to the width of the <td>. Just add 'style="width: 95%"' to each <input> element.

This post has been edited by CharlesEF: Feb 12 2017, 03:42 PM
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Buddy41
post Feb 13 2017, 07:12 AM
Post #18


Newbie
*

Group: Members
Posts: 10
Joined: 12-February 17
Member No.: 26,309



Morning all,
I have now moved the form into its test page of which you can see here, http://www.theremotedoctor.co.uk/test-form...crollto=content

When i view on the pc all is well,when i view on a mobile / tablet etc then media query needs attention.
Now i am honest here and confess i am now 100% stuck.
I have attached s creen shot of the form when vied on an iphone.

Looking at my forms code can you advise what i need to add to the css so phones/tablet etc get the correct look of the form.
I was expecting the form to swap to show vertical input fields.


Attached thumbnail(s)
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 13 2017, 09:59 AM
Post #19


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



QUOTE(Buddy41 @ Feb 13 2017, 01:12 PM) *

Looking at my forms code can you advise what i need to add to the css so phones/tablet etc get the correct look of the form.
I was expecting the form to swap to show vertical input fields.

Not sure what you mean with "correct look" or "vertical input fields", but the best layout for a narrow (e.g. mobile) window might be a single column. Unfortunately that's not possible when using a two-column HTML table for layout.

Instead, you might use CSS to make the layout change depending on window size, search for "responsive design" or similar to learn more about this. It's hard to give more specific advice, since your page already loads several external stylesheets and scripts that may or may not conflict.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2024 - 06:43 PM