The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Little request
Rajatapaus
post Mar 14 2012, 07:32 AM
Post #1





Group: Members
Posts: 6
Joined: 14-March 12
Member No.: 16,701



I need just a small text box and a submit button, when the text is written in the box, and submit pressed, it would change a code value. For example, if my code is:

<input type="hidden" name="return_url_target" value="1">

I type in the text box 3, and press submit, then code is:

<input type="hidden" name="return_url_target" value="3">

Lastly, it would need to be pre defined values (but not visibly), so for example, it would change target code value to 3, but not 4 even if you tried. If it is not too much trouble, i would love to have a version without a pre defined value, and one with a visible pre determined values (for example, shows all possible values when clicked, if you can just tell me the code, i can change it myself).

Is this doable? This is the only thing that I need for my website, and I dont want to spend hours to learn a language, that I'm only going to use once. I would be truly grateful if someone would help me just a bit laugh.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Mar 14 2012, 07:54 AM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,025
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



If there are just a few acceptable values, then why not just use a select element, or a set of radio buttons?

Of course, the server-side (e.g., PHP, CGI) program that processes the form data still needs to verify that the value sent by the form is acceptable.


--------------------
Darin McGrew
WDG Member since 1998
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Rajatapaus
post Mar 14 2012, 08:09 AM
Post #3





Group: Members
Posts: 6
Joined: 14-March 12
Member No.: 16,701



QUOTE(Darin McGrew @ Mar 14 2012, 07:54 AM) *

If there are just a few acceptable values, then why not just use a select element, or a set of radio buttons?

Of course, the server-side (e.g., PHP, CGI) program that processes the form data still needs to verify that the value sent by the form is acceptable.


Ty for your recommendation, however I'm still convinced that I need a box where you can write the value.
I requested all those different things, because I'm using the codes on many different parts, I'm not just making one text box, and some box might have less acceptable values than others.

This post has been edited by Rajatapaus: Mar 14 2012, 08:11 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 14 2012, 02:00 PM
Post #4


.
********

Group: WDG Moderators
Posts: 6,251
Joined: 10-August 06
Member No.: 7



I move this to the Client-side scripting forum.


--------------------
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 14 2012, 02:28 PM
Post #5


.
********

Group: WDG Moderators
Posts: 6,251
Joined: 10-August 06
Member No.: 7



QUOTE(Rajatapaus @ Mar 14 2012, 01:32 PM) *

For example, if my code is:

<input type="hidden" name="return_url_target" value="1">

I type in the text box 3, and press submit, then code is:

<input type="hidden" name="return_url_target" value="3">

What is the purpose of the hidden field? Why not use a textfield with the same name instead:

CODE
<input type="text" name="return_url_target" value="3">

?

QUOTE
Lastly, it would need to be pre defined values (but not visibly)

Why not visibly? Any user can view HTML source and see the permitted values. In a server-side script the values can be hidden, though.

Are you able to edit the server-side script?

QUOTE
Is this doable?

Probably, but I don't understand exactly what you want/need. unsure.gif


--------------------
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Rajatapaus
post Mar 14 2012, 03:57 PM
Post #6





Group: Members
Posts: 6
Joined: 14-March 12
Member No.: 16,701



QUOTE(Christian J @ Mar 14 2012, 02:28 PM) *

QUOTE(Rajatapaus @ Mar 14 2012, 01:32 PM) *

For example, if my code is:

<input type="hidden" name="return_url_target" value="1">

I type in the text box 3, and press submit, then code is:

<input type="hidden" name="return_url_target" value="3">

What is the purpose of the hidden field? Why not use a textfield with the same name instead:

CODE
<input type="text" name="return_url_target" value="3">

?

QUOTE
Lastly, it would need to be pre defined values (but not visibly)

Why not visibly? Any user can view HTML source and see the permitted values. In a server-side script the values can be hidden, though.

Are you able to edit the server-side script?

QUOTE
Is this doable?

Probably, but I don't understand exactly what you want/need. unsure.gif



Hello Christian!

As you can see, I'm a total novice. It seems to work fine when i change that hidden code to visible, so there is no problem there anymore, I feel dumb for not noticing that earlier biggrin.gif

I'm not 100% sure what you mean about server-side scripts, I can access my webpage server with ftp, but thats it.

The only problem anymore is to make a list of permitted values. It is not a huge problem if they can be seen in the source code, except that the values are other peoples e-mails, so I think it would be best to hide them (it would be also embarrassing to see only few e-mails in the list laugh.gif ), but again, I dont think that is a huge problem.

Thank you for your time!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Mar 14 2012, 04:45 PM
Post #7


WDG Member
********

Group: Root Admin
Posts: 8,025
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE
I'm not 100% sure what you mean about server-side scripts
A server-side script is a program (script) that runs on the server. Examples include CGI scripts and PHP scripts.

See also:
http://htmlhelp.com/faq/html/docs.html#about-cgi
http://htmlhelp.com/faq/html/docs.html#about-php
http://htmlhelp.com/faq/html/forms.html#form-howto


--------------------
Darin McGrew
WDG Member since 1998
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 14 2012, 05:37 PM
Post #8


.
********

Group: WDG Moderators
Posts: 6,251
Joined: 10-August 06
Member No.: 7



QUOTE(Rajatapaus @ Mar 14 2012, 09:57 PM) *

I'm not 100% sure what you mean about server-side scripts

A server-side script normally handles the form data after you submitted it (the URL of the script is specified in the form's ACTION attribute). But form elements can also be used with client-side script javascript without submitting anything to the server.

QUOTE
The only problem anymore is to make a list of permitted values. It is not a huge problem if they can be seen in the source code, except that the values are other peoples e-mails,

So you want the user to write an email address in the textfield? Assuming it's a permitted address, what's supposed to happen after that?

QUOTE
I think it would be best to hide them

Note that spambots will find email addresses even they are hidden in the HTML source. But if you don't care about spambots, why not display them as ordinary email links? Seems more user-friendly to me.

QUOTE
(it would be also embarrassing to see only few e-mails in the list laugh.gif )

Not sure I understood that part...


--------------------
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Rajatapaus
post Mar 14 2012, 06:46 PM
Post #9





Group: Members
Posts: 6
Joined: 14-March 12
Member No.: 16,701



QUOTE(Christian J @ Mar 14 2012, 05:37 PM) *

QUOTE(Rajatapaus @ Mar 14 2012, 09:57 PM) *

I'm not 100% sure what you mean about server-side scripts

A server-side script normally handles the form data after you submitted it (the URL of the script is specified in the form's ACTION attribute). But form elements can also be used with client-side script javascript without submitting anything to the server.

QUOTE
The only problem anymore is to make a list of permitted values. It is not a huge problem if they can be seen in the source code, except that the values are other peoples e-mails,

So you want the user to write an email address in the textfield? Assuming it's a permitted address, what's supposed to happen after that?

QUOTE
I think it would be best to hide them

Note that spambots will find email addresses even they are hidden in the HTML source. But if you don't care about spambots, why not display them as ordinary email links? Seems more user-friendly to me.

QUOTE
(it would be also embarrassing to see only few e-mails in the list laugh.gif )

Not sure I understood that part...


Well yes, my web server provider supports PHP and CGI, so if you could make to code in that format it would be nice, so the spam bots don't get me and my friends.


"So you want the user to write an email address in the textfield? Assuming it's a permitted address, what's supposed to happen after that?"

The code that makes the text field, is generated automatically (so no understanding of HTML is required), and is one of those usual stuff that you can just put in your website. The problem is, other people can leech, and use the same service by using their own e-mail, but I want it to be available only for my friends/me/family etc. I don't understand why that matters, there is no problem, just need to make one field to have value restrictions.


"Not sure I understood that part... "

If you can see how many e-mails are in the list, and you only see a few, of course you can assume that there are only a few people using that service, and therefore it is not popular.


Please guys, can you just help me out?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 15 2012, 07:02 AM
Post #10


.
********

Group: WDG Moderators
Posts: 6,251
Joined: 10-August 06
Member No.: 7



QUOTE(Rajatapaus @ Mar 15 2012, 12:46 AM) *

"So you want the user to write an email address in the textfield? Assuming it's a permitted address, what's supposed to happen after that?"

The code that makes the text field, is generated automatically (so no understanding of HTML is required), and is one of those usual stuff that you can just put in your website.

No I meant, what is supposed to happen after the site user (=visitor) has typed an email address in the textfield?

-For example, should the page create an email link? But if the user already knows your email, why not just mail you the usual way?

-Or should the page contain an email form (with message field, etc)? But again, why not let the user mail you the usual way?

QUOTE
The problem is, other people can leech, and use the same service by using their own e-mail, but I want it to be available only for my friends/me/family etc.

If you mean a remotely hosted email service, then of course other people will use it too. But if you want to prevent your own site from becoming a spam generator, hiding email addresses in the HTML may not suffice.

QUOTE
I don't understand why that matters, there is no problem, just need to make one field to have value restrictions.

Afraid I haven't got a clue what you want to do, that's why I'm asking. sad.gif

QUOTE
"Not sure I understood that part... "

If you can see how many e-mails are in the list, and you only see a few, of course you can assume that there are only a few people using that service, and therefore it is not popular.

This seems to contradict your "other people can leech" reply above, but then I probably misunderstand...


--------------------
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Rajatapaus
post Mar 15 2012, 11:42 AM
Post #11





Group: Members
Posts: 6
Joined: 14-March 12
Member No.: 16,701



QUOTE(Christian J @ Mar 15 2012, 07:02 AM) *

QUOTE(Rajatapaus @ Mar 15 2012, 12:46 AM) *

"So you want the user to write an email address in the textfield? Assuming it's a permitted address, what's supposed to happen after that?"

The code that makes the text field, is generated automatically (so no understanding of HTML is required), and is one of those usual stuff that you can just put in your website.

No I meant, what is supposed to happen after the site user (=visitor) has typed an email address in the textfield?

-For example, should the page create an email link? But if the user already knows your email, why not just mail you the usual way?

-Or should the page contain an email form (with message field, etc)? But again, why not let the user mail you the usual way?

QUOTE
The problem is, other people can leech, and use the same service by using their own e-mail, but I want it to be available only for my friends/me/family etc.

If you mean a remotely hosted email service, then of course other people will use it too. But if you want to prevent your own site from becoming a spam generator, hiding email addresses in the HTML may not suffice.

QUOTE
I don't understand why that matters, there is no problem, just need to make one field to have value restrictions.

Afraid I haven't got a clue what you want to do, that's why I'm asking. sad.gif

QUOTE
"Not sure I understood that part... "

If you can see how many e-mails are in the list, and you only see a few, of course you can assume that there are only a few people using that service, and therefore it is not popular.

This seems to contradict your "other people can leech" reply above, but then I probably misunderstand...




...... Lets not make this complicated OK? Here is the sample code:

<input type="visible" name="return_url_target" value="">

Now that creates a small box where you can type whatever you want. There is also a submit button (but not in that particular code) that submits the value that is in the small box.

I want that only a certain values that I have pre determined can be submitted. I'm sorry if i made it sound too complicated.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 15 2012, 01:12 PM
Post #12


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 15,645
Joined: 9-August 06
Member No.: 6



http://www.google.com/search?q=form%20validation

P.S. There is no INPUT type="visible"...


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Rajatapaus
post Mar 15 2012, 02:57 PM
Post #13





Group: Members
Posts: 6
Joined: 14-March 12
Member No.: 16,701



QUOTE(pandy @ Mar 15 2012, 01:12 PM) *

http://www.google.com/search?q=form%20validation

P.S. There is no INPUT type="visible"...




....... Cant find a simple code that would check if the check box has equal value as the value in my server side, not in PHP at least.

Could someone just give a code for that, and tell me how to set it up on a server side?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 15 2012, 03:29 PM
Post #14


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 15,645
Joined: 9-August 06
Member No.: 6



You mean something simple like <CHECK>? There isn't anything like that. You must make the script check if the entry is one of the desired email addresses. I'm not even clear about if you run your own script and can edit it or use some kind of service.


--------------------
"Never go to excess, but let moderation be your guide."
- Cicero

IPB Image
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: 27th November 2014 - 12:04 PM