can submit text links pass form fields?

M

M

i am using submit buttons to send the user to different parts of a wizard.
i am using if (if attribute.step1 exists) statements to send them to the
appropriate section based on which submit button they pressed.

well i would like to change these submit buttons into text links instead.
however they do not pass form parameters like the submit button. any simple
ways to accomplish this?

this is what i have so far:

<form name="movwizform">

<script language="javascript" type="text/javascript">
<!--
function getmovWiz ( selectedtype )
{
document.movwizform.supporttype.value = selectedtype ;
document.movwizform.submit() ;
}
-->
</script>

<a href="javascript:getmovWiz('step1')">step 1 - details</a>
<a href="javascript:getmovWiz('step2')">step 2 - cast</a>

</form>


THANKS!!
 
R

Robert

i am using submit buttons to send the user to different parts of a wizard.
i am using if (if attribute.step1 exists) statements to send them to the
appropriate section based on which submit button they pressed.

What's wrong with buttons? They work.

Folks uses other pages than yours. They know that to complete a form
that they need to press a buttons. To use a link, would confuse them.


Use the submit() function to submit the form.

document.movwizform.submit()
 
M

M

actually i answered my own question in the post. i just wasnt thinking
clearly, a hidden form field with the name 'supporttype' passes the data i
need.

i dont want buttons, becuase using tabs instead is more user friendly and it
looks a WHOLE lot better. a submit button will be used when the data is
actually submited for entry. thanks for your input though.
 
R

RobG

M said:
i am using submit buttons to send the user to different parts of a wizard.
i am using if (if attribute.step1 exists) statements to send them to the
appropriate section based on which submit button they pressed.

Why use a form? Why not use anchors and plain URLs? No
javascript needed (or even a form).

[...]
<form name="movwizform">

An action is required, even if it's action="" - though I think
your use of a form is completely unnecessary.
<script language="javascript" type="text/javascript">

The language attribute is depreciated and replaced by type.

No need to hide scripts.
function getmovWiz ( selectedtype )
{
document.movwizform.supporttype.value = selectedtype ;
document.movwizform.submit() ;
}
-->
</script>

<a href="javascript:getmovWiz('step1')">step 1 - details</a>

No need for "javascript:...". This "link" will be totally
inoperative for anyone with JavaScript disabled. Consider:

<a href="help.html#step1_details" onclick="
getmovWiz('step1'); return false;">step 1 - details</a>

At least then someone without JavaScript will still be sent
somewhere useful - return false will cancel the navigation if JS
is enabled.

[...]

You could also consider using frames, with your links in a left
pane and document contents in the main part of the window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top