aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes HREF submit without javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "HREF submit without javascript" Watch "HREF submit without javascript" New topic
Author

HREF submit without javascript

Venkataramanan Amirthalingam
Greenhorn

Joined: Nov 27, 2008
Posts: 20
Hi All,

In our application, we have a requirement to put HREF's and on clicking it, it should take to next action with few parameters. We do not want to append parameters in HREF using '?'. Also we should not be using javascript/CSS to submit the form.

Is there a way to submit a HREF without javascript.

Thanks,
venkat
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42632
    
  65
If there are parameters, have you considered making this a FORM submit button (which can look pretty similar to a regular HREF link if you style it that way) ?


Ping & DNS - my free Android networking tools app
Venkataramanan Amirthalingam
Greenhorn

Joined: Nov 27, 2008
Posts: 20
Hi Ulf,

The constraint is, we should not be using CSS. So how to address this?

Thanks
--venkat
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Venkataramanan Amirthalingam:
Hi Ulf,

The constraint is, we should not be using CSS. So how to address this?

Thanks
--venkat


Why do you think the HTML Form tag has anything to do with CSS? Just do what Ulf said. If you can't, then you are out of luck. Without query parameters (?foo=1&foo=2) there is no way to get an anchor tag to send values to a different page.


GenRocket - Experts at Building Test Data
Venkataramanan Amirthalingam
Greenhorn

Joined: Nov 27, 2008
Posts: 20
Hi,

If i put a submit button, then i need to do some styling to make it look like <a> tag. Without CSS, can we achieve this styling? Also, if i put submit button, then the user will not know which all links he previously visited. Am i right?

Is there a way to solve?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61656
    
  67

I can almost understand the proscription against JavaScript -- it could appropriate in some environments -- but what sane reason is there for prohibiting CSS?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30948
    
158

Some places have a requirement that the page should be usable without CSS. (for blind or vision impaired readers.) However, these users could still click on the button via the form submit.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Venkataramanan Amirthalingam
Greenhorn

Joined: Nov 27, 2008
Posts: 20
Hi,

The reason for not using CSS is, our application should be accessible from mobile device. And not all mobile devices support javascript or CSS. This is where we got struck.. and i am searching for solution
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61656
    
  67

That's the sort of thing that should be mentioned in your first post.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Originally posted by Venkataramanan Amirthalingam:
We do not want to append parameters in HREF using '?'.


Why exactly not?
Nitin Pathak
Ranch Hand

Joined: Sep 25, 2006
Posts: 70
Maybe if you can use the images in your web (M) pages, you can try submitting the form through input type "image":

This is taken from one of my running applications using Django.
[ December 16, 2008: Message edited by: Nitin Pathak ]
 
 
subject: HREF submit without javascript