Jump to content
Safariphoto

W3.css form handling

Recommended Posts

I see that in the W3.Css demo and templates there is use of forms. When I tried to edit this for use with HTML/PHP The button for the HTML form only works when the Modal Submit is used.

 

<div id="id01" class=" w3-modal" >

...

<form action="subscribe.php" method="POST">
<input name="subname" class="w3-input" placeholder="Full Name" type="text" required>
<input name="subemail" class="w3-input" placeholder="Email Address" type="text" required>
<label class="w3-label w3-validate">Subscribe to e-Mail Newsletter</label>
<input class="w3-btn" type="submit" value="Submit">
<p><a class="w3-btn w3-center" href="">Submit</a></p>
</form>

...

 

 

I've also tried the following and the variables are not passed to the php script.

...

<form>
<input name="subname" class="w3-input" placeholder="Full Name" type="text" required>
<input name="subemail" class="w3-input" placeholder="Email Address" type="text" required>
<label class="w3-label w3-validate">Subscribe to e-Mail Newsletter</label>
<p><a class="w3-btn w3-center" href="subscribe.php">Submit</a></p>
</form>

...

 

 

Any help is appreciated.

 

Thanks

 

Mike

Share this post


Link to post
Share on other sites

Are you talking about the link? Its a link it will just go to link specified in href, the value of '#' will just go to current form page again.

 

At the minimum you require the location value to send input values to specific page applied to action attribute and a input type submit button, or button element.

 

A link will only work if javascript function is triggered that will submit the form as though a submit button was clicked.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...