Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Update a text box withOUT using a script?

Reply
Thread Tools

Update a text box withOUT using a script?

 
 
Martin
Guest
Posts: n/a
 
      07-22-2005
Hmmm - lets try this again with the correct title


I have a page that has some radio buttons on it (<input
type="radio">); there is also a text field (<input type="text">). When
the user clicks one of the radio buttons, I would like to show the
selected button's index number in the text field.

I realize this would be trivial by using a script but I'd like to do
it without a script (to accomodate "scriptless" users).

Is there any way to do this?

TIA
 
Reply With Quote
 
 
 
 
SpaceGirl
Guest
Posts: n/a
 
      07-22-2005
Martin wrote:
> Hmmm - lets try this again with the correct title
>
>
> I have a page that has some radio buttons on it (<input
> type="radio">); there is also a text field (<input type="text">). When
> the user clicks one of the radio buttons, I would like to show the
> selected button's index number in the text field.
>
> I realize this would be trivial by using a script but I'd like to do
> it without a script (to accomodate "scriptless" users).
>
> Is there any way to do this?
>
> TIA


No it cannot be done. Anything that changes the content cannot be done
without *some* sort of scripting (the exception being :hover in CSS,
which CAN be used to add sort-of interactivity... except it doesnt work
in IE apart from on hyperlinks).

HTML is "dumb". Once it is rendered that's it. You can do anything else
to it without scripting as it's just a page full of text codes in reality.

--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
# this post (c) Miranda Thomas 2005
# explicitly no permission given to Forum4Designers
# to duplicate this post.
 
Reply With Quote
 
 
 
 
Ken in Melbourne Australia
Guest
Posts: n/a
 
      07-23-2005
SpaceGirl wrote:
>> I have a page that has some radio buttons on it

....
>> I realize this would be trivial by using a script but I'd like to do
>> it without a script (to accomodate "scriptless" users).
>>
>> Is there any way to do this?
>>
>> TIA

>
> No it cannot be done. Anything that changes the content cannot be done
> without *some* sort of scripting

....
> HTML is "dumb". Once it is rendered that's it. You can do anything else
> to it without scripting as it's just a page full of text codes in reality.


Cannot be done??? Emmm!! I'm a great believer in never
saying cannot.

If we look at the question it says that we are trying to
accommodate "scriptless" users. Therefore we can assume
that the meaning of script is script running on the client.
Now this may not be the greatest as it means some delays
but couldn't you do it with a program on the Server.

User presses what looks like a radio button. This activates
form output to the server program. Server program resends
page with the text field updated.

Fairly easy program in php on the server I would think.
An HTML question in this is how to get the form to output
back to the host as soon as a radio button is pressed.
Couldn't we replace the form radio buttons with a group of
Submit buttons which have been created to look like radio
buttons?

I haven't tried any of this so maybe there are problems here
that I don't know about. Can anyone tell me if this would
work or if there is a problem with it. Better still, tell
me if you actually get it going!

Ken
in Melbourne
 
Reply With Quote
 
Martin
Guest
Posts: n/a
 
      07-23-2005
On Sat, 23 Jul 2005 21:57:31 +1000, Ken in Melbourne Australia
<(E-Mail Removed)> wrote:

>SpaceGirl wrote:
>>> I have a page that has some radio buttons on it

>...
>>> I realize this would be trivial by using a script but I'd like to do
>>> it without a script (to accomodate "scriptless" users).
>>>
>>> Is there any way to do this?
>>>
>>> TIA

>>
>> No it cannot be done. Anything that changes the content cannot be done
>> without *some* sort of scripting

>...
>> HTML is "dumb". Once it is rendered that's it. You can do anything else
>> to it without scripting as it's just a page full of text codes in reality.

>
>Cannot be done??? Emmm!! I'm a great believer in never
>saying cannot.
>
>If we look at the question it says that we are trying to
>accommodate "scriptless" users. Therefore we can assume
>that the meaning of script is script running on the client.
> Now this may not be the greatest as it means some delays
>but couldn't you do it with a program on the Server.
>
>User presses what looks like a radio button. This activates
> form output to the server program. Server program resends
>page with the text field updated.
>
>Fairly easy program in php on the server I would think.
>An HTML question in this is how to get the form to output
>back to the host as soon as a radio button is pressed.
>Couldn't we replace the form radio buttons with a group of
>Submit buttons which have been created to look like radio
>buttons?
>
>I haven't tried any of this so maybe there are problems here
>that I don't know about. Can anyone tell me if this would
>work or if there is a problem with it. Better still, tell
>me if you actually get it going!
>
>Ken
> in Melbourne


Ken -

Your approach was exactly what I had in mind if I couldn't figure out
how to do it on the client side. In fact, my next question was going
to be, "how do I get a radio button to submit the form (without using
scripting)?".

The page in question is already being generated by a PHP script so
adding this functionality would be relatively easy.

I'll let you know how it goes.

Thanks.
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      07-23-2005
Martin wrote:
<snip>
> Your approach was exactly what I had in mind if I couldn't figure out
> how to do it on the client side. In fact, my next question was going
> to be, "how do I get a radio button to submit the form (without using
> scripting)?".

<snip>

I think this is the Catch-22 part... Only the form's SUBMIT button's
behavior submits the form. To change the default behavior any other form
element, like the RADIO button requires scripting! The only other way
way is to have an 'update' button ,(i.e., a SUBMIT button!) that the
user must click to update the form, just what you are trying to avoid!

<soapbox>

There are applications where client-side scripting is just the 'right'
tool for the job. Fast, responsive, interactive can really enhance the
usability of a webpage without loading the server. But because some
browser's poor security model we have to throw this all out much of time
or find convoluted server-side hacks to try and duplicate what could
easily be done in JavaScript. Wouldn't it be nice to have all the tools
at our disposal?

HTML for content,
CSS for presentation,
CGI for content processing,
AND JavaScript for behavior.

</soapbox>

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
SpaceGirl
Guest
Posts: n/a
 
      07-24-2005
Ken in Melbourne Australia wrote:
> SpaceGirl wrote:
>
>>> I have a page that has some radio buttons on it

>
> ...
>
>>> I realize this would be trivial by using a script but I'd like to do
>>> it without a script (to accomodate "scriptless" users).
>>>
>>> Is there any way to do this?
>>>
>>> TIA

>>
>>
>> No it cannot be done. Anything that changes the content cannot be done
>> without *some* sort of scripting

>
> ...
>
>> HTML is "dumb". Once it is rendered that's it. You can do anything
>> else to it without scripting as it's just a page full of text codes in
>> reality.

>
>
> Cannot be done??? Emmm!! I'm a great believer in never saying cannot.
>


Can you turn my can of Coke into a car? No. It can't be done.

> If we look at the question it says that we are trying to accommodate
> "scriptless" users. Therefore we can assume that the meaning of script
> is script running on the client. Now this may not be the greatest as it
> means some delays but couldn't you do it with a program on the Server.


Yes you could do it at the server, but that's not what I thought he was
asking. He suggested he wanted a scriptless solution. Even if you do it
at the server, a script is being run... albeit on the server

> User presses what looks like a radio button. This activates form
> output to the server program. Server program resends page with the text
> field updated.


Yes that would be the way to do it. Use an image of a radio button so
that it "pretends" to be a radio, when really it is a submit button. It
causes the whole thing to be posted to the server and you can then send
the whole back again to the client with the text modified.

<snip>

> I haven't tried any of this so maybe there are problems here that I
> don't know about. Can anyone tell me if this would work or if there is
> a problem with it. Better still, tell me if you actually get it going!


I've done this on a few sites to fake UI elements; it can work really weel.

--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
# this post (c) Miranda Thomas 2005
# explicitly no permission given to Forum4Designers
# to duplicate this post.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
Update without using Edit and Update button Henke ASP .Net Datagrid Control 1 06-01-2006 02:55 PM
Linking a text box and/or a list box to an Access table's column. ryan.d.rembaum@kp.org ASP .Net 1 08-05-2005 04:17 AM
Update a text box with using a script? Martin HTML 0 07-22-2005 09:25 PM
Datalist: update a datasource without using select/edit/update Hartmut Schroth ASP .Net 3 12-01-2003 09:54 AM



Advertisments