so I have this HTML form with two buttons that say "Accept" and "Decline."
<div class="disclaimerAD top">
<form enctype="application/x-www-form-urlencoded" action="index.html" method="post">
<input type="hidden" name="id" value="5" id="id">
<input type="hidden" name="process" value="1" id="process">
<input type="submit" name="accept" id="accept" value="Accept">
<input type="submit" name="decline" id="decline" value="Decline"></form> </div>
<form enctype="application/x-www-form-urlencoded" action="index.html" method="post">
<input type="hidden" name="id" value="5" id="id">
<input type="hidden" name="process" value="1" id="process">
<input type="submit" name="accept" id="accept" value="Accept">
<input type="submit" name="decline" id="decline" value="Decline"></form>
This isn't my code, I don't know why there's two.
Right now hitting either "Accept" or "Decline" brings the user to "index.html." But I want hitting "Accept" to bring the user to "index.html" and hitting "Decline" to just refresh the page, which is called "5.html". How can I get this to work?
Remove the Decline input field and use a link to 5.html instead. You can get them to look the same with CSS if needed.
Related
I have a superfish menu containing two forms, a search box in superfish tab 1 and a newsletter signup in tab 3. The search form works fine, and the newsletter signup works fine so long as the search form isn't present on the page. But when both are present, the submit button on the newsletter signup form appears to try and submit a search instead, which not only doesn't sign the user up for the newsletter, but it doesn't search for anything either.
My code goes like this:
<form class="search-form" action="/search/node" method="post" id="search-form" accept-charset="UTF-8"><div><div class="container-inline form-wrapper" id="edit-basic"><div class="form-item form-type-textfield form-item-keys">
<input type="text" id="edit-keys" name="keys" value="" size="20" placeholder=" Search this site" maxlength="255" class="form-text" />
</div>
<input type="submit" id="edit-submit" name="op" value="Go" class="form-submit" /></div><input type="hidden" name="form_build_id" value="form--JTbYKjZwG8SjIstLVU7J0HOiZZiSoB88bE4VoRYTG4" />
<input type="hidden" name="form_token" value="HoVlLGidOtcgITb3XmNhvH7mKKzW8ldmnahr3t0HGAU" />
<input type="hidden" name="form_id" value="search_form" />
<many other divs>
<form class="webform-client-form" enctype="multipart/form-data" action="/content/newsletter-signup" method="post" id="webform-client-form-22" accept-charset="UTF-8"><div>
<div class="form-item webform-component webform-component-email webform-container-inline" id="webform-component-email">
<input class="email form-text form-email required" type="email" id="edit-submitted-email" placeholder="Email address" name="submitted[email]" size="24" />
</div>
<div class="form-item webform-component webform-component-textfield webform-container-inline" id="webform-component-name">
<input type="text" id="edit-submitted-name" name="submitted[name]" value="" placeholder="Name" size="14" maxlength="128" class="form-text required" /> <input type="submit" id="edit-submit" name="op" value="Submit" class="form-submit" />
</div>
<input type="hidden" name="details[sid]" value="" />
<input type="hidden" name="details[page_num]" value="1" />
<input type="hidden" name="details[page_count]" value="1" />
<input type="hidden" name="details[finished]" value="0" />
<input type="hidden" name="form_build_id" value="form-I8MgMoURjB6BhqJATKhhNZ5nAUwk855bGWgxH75Gs5Q" />
<input type="hidden" name="form_token" value="IKALClB6fmkRPFA6Ko8VIbBN2uDEwpVBxFM6w2_2JAo" />
<input type="hidden" name="form_id" value="webform_client_form_22" />
</div></form>
How can I get the submit button on the second (newsletter signup) form to submit that form and not the search?
I have the following code but unlike the code generated on the Paypal button generator, this does not show a image as a button; only text.
I'm not using the hosted button solution, but my method is supported, I just can't figure out how to make the button show an image (preferably the 'Buy Now') instead of just the plain text.
Is there a tag I missed somewhere?
<form target="_blank" class="paypal-button" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="item_name_1" value="<?=$serverFullDesc?>">
<input type="hidden" name="amount_1" value="<?=$costMonth_step1?>">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="item_name_2"value="Initial Server Build (one-time)">
<input type="hidden" name="amount_2" value="<?=$buildPrice?>">
<input type="hidden" name="quantity_2" value="1">
<input type="hidden" name="item_name_3"value="<?=$maintPlan?> - invoiced monthly">
<input type="hidden" name="amount_3" value="<?=$maintPlanPrice?>">
<input type="hidden" name="quantity_3" value="1">
<input type="hidden" name="amount" value="<?=$gTotalPayment?>">
<input value="buynow" name="button" type="hidden">
<input value="_cart" name="cmd" type="hidden">
<input name="upload" value="1" type="hidden">
<input value="<?=$currency?>" name="currency_code" type="hidden">
<input value="XXXXXXXXXXXX" name="business" type="hidden">
<input value="www" name="env" type="hidden">
<button class="paypal-button large" type="submit">Buy Now</button>
</form>
The button for Buy Now has the classes "paypal-button large" Where is the CSS for paypal-button coming from? That's what you need.
I need to have two step submission form which accepts multiple images to be uploaded to server. The problem here is I need to have some temporary hidden inputs for storing values from the first step to acquire more info in the second step before the actual submission.
Take a look the following codes.
This is for example, the first step:
<form action="" enctype="multipart/form-data" method="post">
<input type="hidden" name="step" value="1" />
Name: <input name="name" value="" type="text" />
Email: <input name="email" value="" type="text" />
Image 1: <input type="file" name="images[]" />
Image 2: <input type="file" name="images[]" />
<input type="submit" value="Submit" />
</form>
The following will be the second step:
<form action="" enctype="multipart/form-data" method="post">
<input type="hidden" name="step" value="2" />
<input name="name" value="<?=$_POST['name'];?>" type="hidden" />
<input name="email" value="<?=$_POST['email'];?>" type="hidden" />
<!-- Here is the problem, how should I store the submitted images for the time being? -->
<input type="file" name="images[]" />
<input type="file" name="images[]" />
<!-- ... -->
Please select a type:
<select name="type">
<option>Type 1</option>
<option>Type 2</option>
</select>
<input type="submit" value="Submit" />
</form>
Please note that this code is just for the sake of clarification and is by no means the actual code.
They should be stored in $_FILES I think. You can also use move_uploaded_file() for storing the files temporarly. See: php-manual
I want to update a field in my html form separately from the rest. I know we can't have embedded forms in html so how can I make this work?
<form name="LabelForm" method='POST' action="lab/CA/ALL/createLabel.do">
<input type="hidden" name="lab_no" value="<%=lab_no%>">
<input type="hidden" name="aNum" value="<%=aNum%>">
<input type="hidden" name="label" value="<%=label%>">
<td><input type="submit" value="Create" /></td>
</form>
In the above code, the submit button is outside the main table which is part of another form called ackform. I want to put the submit button in the main table(so everything's neat and orderly) but make it part of LabelForm. The value that is entered by the user is "label" which I want to submit with the LabelForm.
Here's my guess:
<form name="TDISLabelForm" method='POST' action="lab/CA/ALL/createLabelTDIS.do">
<input type="hidden" name="lab_no" value="<%=lab_no%>">
<input type="hidden" name="accessionNum" value="<%=accessionNum%>">
<input type="hidden" id="label" name="label" value="<%=label%>">
<td><input type="submit" value="Create" /> <input type="button" onclick="form2.submit()" value="save in the hidden form">
</td>
</form>
<form name="form2" target="fr1" action="....your post code..." method="post">
<input type="hidden" id="label" name="label" value="<%=label%>">
</form>
<iframe style="height:1px;width:1px;border:none:" id="fr1"></iframe>
I have a link class.php?event=donbass2012
and I have a html form. How to send value from form to url to get link like this:
class.php?event=donbass2012&class=f1a
Just use a normal GET form, with whatever inputs you need.
<form action="class.php">
<input type="hidden" name="event" value="donbass2012">
<input type="hidden" name="class" value="f1a">
<input type="submit">
</form>
Is this what you want?
<form name="input" action="class.php" method="get">
<input type="hidden" name="event" value="donbass2012" />
<input type="hidden" name="class" value="f1a" />
<input type="submit" value="Submit" />
</form>