aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes make javascript form accesible 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 "make javascript form accesible" Watch "make javascript form accesible" New topic
Author

make javascript form accesible

Jorge Blaz
Ranch Hand

Joined: Jan 31, 2004
Posts: 53
Hello,

I have a table with ten rows, for example. The table has three columns and the first one has a checkbox per row. So, you can select one or more rows by checking the corresponding checkbox. Then you have three buttons, each of them to do a different action with the rows selected.
The table and buttons are surrounded by a form. But what i want is to submit to a different location when each button is clicked.
What I do now is to have an onclick event on the buttons and then with Javascript I change the action attribute of the <form> tag.
But I want to make it accesible, I mean, that if someone disables Javascript, that the form still works. Any ideas?

Thanks in advance
Jorge
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You have to handle it on the server than. No other option. Look to see what button was clicked in the form submission.

Eric
Jorge Blaz
Ranch Hand

Joined: Jan 31, 2004
Posts: 53
Originally posted by Eric Pascarello:
You have to handle it on the server than. No other option. Look to see what button was clicked in the form submission.

Eric


Thanks Eric :-)

I have done it the way you say. Since I'm using Struts i used an Action who looks which buttons was clicked and then link to the appropiate page.
But I still have one problem.

I have some hiddens that are set when each button is pressed. These hiddens are different from one button to the other. That means, if i click button1, the hiddens are sent with some values. When I click button2, these hiddens are sent with other values (i sent them with javascript-onclick event).

No, if i do the button-clicked check on the server, I don't know how can i send the related hidden values to the clicked button.

I could have the same hiddens repeated with different names for each button, and then sent all of them, the ones related to the clicked button will have been populated with values and all the others will be sent blank. But I don't really like this solution. Maybe you can point me to other ideas.

Thanks a lot
Jorge
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: make javascript form accesible