473,326 Members | 2,111 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,326 software developers and data experts.

How to do this without javascript ?

Already posted in comp.lang.javascript but not found any solution :-(
--

Hi all,

Don't know where to ask my question because the way to go is included in
the possible answer itself by nature... You'll understand better below :

Well, I have an HTML page containing a form in which an options group
provides two ways to submit content of a file :

- 1st way : base64 data in a textarea field.
- 2nd way : path to local file in a file field

So, to achieve this, when user click on a checkbox of this option group,
a javascript code manages to create and remove appropriated form fields.
And this works well until now.

Here is a test page showing this switching :
--------------------------------------------
http://yohannl.tripod.com/file_form_...m_switcher.htm

And here is the source of the page :
------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function addrem(id,op)
{
var area = document.getElementById('ftest');
var elt = document.getElementById(id);

if (op == 1){ // add field
if (elt != null){
return;}
if (id == "base64"){
elt = document.createElement('textarea');
elt.cols = "60";
elt.rows = "10";
elt.value = "(paste Base64 data here)";}
else {
elt = document.createElement('input');
elt.type = "file";}
elt.id = id;
elt.name = "file";
area.appendChild(elt);}
else { // remove field
if (elt != null){
area.removeChild(elt);}}}
</script>
</head>
<body>
<h3>File Form Switcher</h3>
<input type="submit" value="Submit">
<form id="ftest" action="/bin/engine.pl" method="post"
enctype="multipart/form-data">
<input type="radio" name="file" value="0" onclick="addrem
('local',0);addrem('base64',1);"Base64 Data<br>
<input type="radio" name="file" value="1" onclick="addrem
('base64',0);addrem('local',1);"Local Path<br><br>
</form>
</body>
</html>

So, my question is :
--------------------
Is there a way to achieve this same objective (submit a textarea or a
file field) without any javascript (some browsers will have disabled
javascript support) ?

Knowing the two ways shouldn't be available in the same time (to avoid
user pastes a base64 data in first field AND indicates a local file path
in the second one, both) : one or another according to user choice using
option checkboxes.

Maybe through CSS, don't know. Do you have an idea ?
May 21 '07 #1
1 1300
VK
On May 21, 1:29 pm, Asterbing <n...@thanks.comwrote:
Already posted in comp.lang.javascript but not found any solution :-(
That is not a reason to re-post the same every few days. Wait for more
answers in the original thread.

Overall is it some late springtime trend? "- How to use Javascript
without using native Javascript tools?" (Rebekka), "- Hey, Javascript
programmers, how to avoid Javascript?" (Asterbing)
:-) :-|

1) Make two separate HTML pages with forms, load one page by default
but provide a link on each page so user could load this or that form
depending on her choice.

2) Ask comp.infosystems.www.authoring.stylesheets is they have some
creative ideas about pseudo-element usage (:visited, :active, :hover
etc). Bearing in mind IE6 limited support for that I would avoid it if
possible.

May 21 '07 #2

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

Similar topics

16
by: Safalra | last post by:
Frequently in ciwah people say 'but what about the users without JavaScript?', so I decided to do an experiment. It suggests 35% internet users do not have JavaScript turned on in their browsers....
7
by: Mark | last post by:
Hello; Here is what I wish to do: Click on a PDF link and have it open as a full screen window - not as a predetermined size. Sounds simple? I want to run the command from within the...
8
by: Dan | last post by:
hello all, is there a way to open a new window without javascript and a href=_blank? i need to connect a button click with some lines of code and then, a new window shall get opened. but i didn't...
3
by: Eych | last post by:
is it possible to resize the browser window at run-time without javascript? thanks...
1
by: the friendly display name | last post by:
Simple question: How to make datagrid paging work without javascript? I have a simple datagrid, which gets populated by a dataview, it works perfectly, paging works too, but, as I said, it...
2
by: Alan Silver | last post by:
Hello, I have just discovered that if you turn off Javascript, then cross-page posting does not work. The postback goes to the originating page, which basically means that nothing happens. I...
9
by: Man-wai Chang | last post by:
How do/would you implement a pop-up window for user to pick a value out of a searchable list and then pass it back to the textbox? -- iTech Consulting Services Limited Expert in ePOS...
9
by: Asterbing | last post by:
Hi all, Don't know where to ask my question because the way to go is included in the possible answer itself by nature... You'll understand better below : Well, I have an HTML page containing a...
6
by: mistral | last post by:
Is there way change image (swap) on click on thumbnail without javascript? I.e. main image is big(preview), and below it is two small images - when click on small image, it should change big image....
23
by: WebFoot | last post by:
Is there a reliable way for a webpage to either break out or refuse to display when a hostile website puts it in a frame? I know about the JavaScript solution, but not all visitors have...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.