Link to home
Start Free TrialLog in
Avatar of carldpatterson
carldpatterson

asked on

Submit Button

Does anyone know how to change a 'Submit' type button to a
link?

The HTML Client requires a button with a name as follows:-

<input type='submit' value='Go Back' name='bKEY_interrupt'>

This tells the 4GL program what to do. I've tried :-

<a href='JavaScript:submitForm()'>

But it needs to have a name to work correctly.
Avatar of ManoloMA
ManoloMA

Try with:

<form id="frm">
</form>

<a onclick='JavaScript:frm.submit()' href=''>



Try this:

<FORM METHOD=POST ACTION="URL" id=form1 name=form1>
Click the button to go URL.
<input type='submit' value='Go' name='bKEY_interrupt'>

Hope this will help.
Depends if you need it to actually submit or not.  For a simple link, do this...
<form>
<input type="button" value="yourval" onClick="location.href='page.html'">
</form>

need the form tags to be viewed in NN
Avatar of carldpatterson

ASKER

I want to change the grey button so that it will look the same as the other links on our bannner bar.
Avatar of knightEknight
Do you mean you want it to be an image?

<INPUT type='image' src='mysubmit.gif'>
For a regular link, I prefer this method:

<A href='#' onClick='document.NameOfYourForm.submit();return(false);>Submit</a>
If you are simply trying to submit a form with a normal link, then ManoloMa has the right solution, though I would do it like this (more browser safe):
<FORM name="formname" action="something.cgi">
<!- form contents.... -->
</FORM>
<A HREF="JavaScript:;" onClick="document.formname.submit(); return false;">Submit me:)</A>

-Josh
Sheez! kek slipped in two comments while I was writing that out....
... I hate when that happens  :)
this is probably all the same, but this is what i do

<form method=post action = "http://www.yahoo.com">
<input type = "submit" value = "Goto Yahoo"></form>

I found out you have to have the </form> tag or else netscape wont run it.

it's pretty much the same as qiang8's but make sure you use the </form>
OK, if _I_ understand this correctly he wants to have a link which submits the form, BUT when the page gets send to the server program it will look at what button has send the request. if that name equals a certain value then it'll process that stuff. So a <a href="javascript:form.submit()"> won't work since it doesn't have a name nor, if you do specify a name in the A tag, send the name of a normal A tag. So, what you might want to do is to call the click() of the button which has to send the form...I don't know if this'll work properly but you can try it. Or (depends what the method of the form is, either post or get) you can put some additional query in the querystring.

Good luck
ASKER CERTIFIED SOLUTION
Avatar of jbirk
jbirk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial